|
How to check whether your program is running on Windows NT/2000 ?
|
Total Hit (2057) |
This simple code will tell you whether your program is running on NT/2000 platform or Win9x/ME.
«b»Step-By-Step Example«/b»
- Create a standard exe project
- Add the following code in the form1 code window
«b»Form1.frm«/b»
«code LangId=1»' Types, constants and functions for OS version d
....Read More |
Rating
|
|
|
How to bring window to the front in Windows 2000/ME ?
|
Total Hit (4340) |
Have you ever tried to use SetForegroundWindow function in Windows 2000/ME ? In windows 9x its very easy to set foreground window, just pass window handle to SetForegroundWindow and done... But in Windows 2000 and ME microsoft has changed the process for setting foreground window. In windows 2000 an
....Read More |
Rating
|
|
|
How to force a window to be a ForeGround Window on Win 9x/NT both ?
|
Total Hit (8855) |
Microsoft changed the rules with Win98 and Windows 2000 . The SetForegroundWindow API can no longer be used directly to take focus away from another application. Here is the code to implement ForceForeGround window functionality.
Here I have used VB function that uses AttachThreadInput together w
....Read More |
Rating
|
|
|
How to resize window accurately to get desired client area ?
|
Total Hit (7455) |
Sometimes you might get unexpected window size when you resize or assign different height or width. To resize or change window height/width accurately based on required client area you can use AdjustWindowRect or AdjustWindowRectEx api. You can pass required client area as a RECT parameter to Adjus
....Read More |
Rating
|
|
|
How to send a specific windows message to all windows ?
|
Total Hit (3348) |
Many times we need to send a specific message to other applications or windows itself to notify regarding some event. Windows provides a function called BroadcastSystemMessage. The BroadcastSystemMessage function sends a message to the specified recipients. The recipients can be applications, instal
....Read More |
Rating
|
|
|
How to show/hide taskbar, desktop icons and start button ?
|
Total Hit (16330) |
This sample code will show you how to use FindWindow api to get handle to various window by window title. If you have window handle then you can use APIs like ShowWindow, SetWindowPos and many more to perform various operations (e.g. hide/show, resize etc.) to that window.
«b»Step-By-Step Exampl
....Read More |
Rating
|
|
|
Create your own cursor at runtime
|
Total Hit (3254) |
Sometimes you might need to create your own cursor at runtime without using any image or resource. You can achive this functionality using CreateCursor API. Here is the basic guidelines for creating your own cursor.
When you call CreateCursor you have to pass Application handle, Cursor Width, Curso
....Read More |
Rating
|
|
|
|
Move Form without title bar (2 different methods)
|
Total Hit (3890) |
You can move a form which has no titlebar by 2 different methods. First method will not show any drag border while second method will show drag borders.
«code LangId=1»'//////////////////////////////////////////////////////////
'// Move Form Without Title bar (Method-1: Without drag border)
'////
....Read More |
Rating
|
|
|
|
Tray to Title and Title to Tray Effect using DrawAnimatedRects API
|
Total Hit (4361) |
This little snippet will give you an effect so it looks like that your window is flying from system tray or minimizing to system tray depending on which flag you pass to DrawAnimatedRects API.
Create a standard exe project and place the following code in form1 and run the project to see the effec
....Read More |
Rating
|
|
|
Creating an API Window (Using C Style Message Loop and Window Proc)
|
Total Hit (11029) |
Sometimes you might need to create a window using code on the fly. Many times I have been asked that why do I write this odd code to create a very simple form,I can use VB form instead of Dynamic C style window creation....
Now here is the answer
One common use of this technique in socket pro
....Read More |
Rating
|
|
|
|
Tip: How to display all environment variables
|
Total Hit (2449) |
«code LangId=1»Private Declare Function GetEnvironmentStrings Lib "kernel32" Alias "GetEnvironmentStringsA" () As Long
Private Declare Function FreeEnvironmentStrings Lib "kernel32" Alias "FreeEnvironmentStringsA" (ByVal lpsz As String) As Long
Private Declare Function lstrlen Lib "kernel32" Alias
....Read More |
Rating
|
|