Jalaj P. Jha

Technical & Miscellaneous Ramblings

Archive for January 2007

WinAPI : Getting Window Texts

without comments

Window Text of a window is the caption on the title bar if the window is a form, or the text contained it the window in question here is a control on some form. Getting a window text or setting it requires calling the SendMessage function (described in More on SendMessage) with messages WM_GETTEXT and WM_SETTEXT resp.
Read the rest of this entry »

Written by Jalaj

January 31, 2007 at 4:24 am

Posted in Visual Basic, WinAPI

Tagged with

WinAPI : Prevent Setting foreground window

without comments

The earliest Windows Operating Systems allowed any process to set the foreground window. However with Windows98/Me restriction were placed for which process should be allowed to set a foreground window. That may be the process itself in the foreground or a process started by it or the process that last received the input event. Any other process can set foreground window only if there is no other process in foreground or explicitly allowed using the AllowSetForegroundWindow function or no lock has been placed using LockSetForegroundWindow function. Windows98/Me allows setting a foreground lock timeout which if set to zero makes the operating system behave as with the earlier versions.
Read the rest of this entry »

Written by Jalaj

January 30, 2007 at 5:20 am

Posted in Visual Basic, WinAPI

Tagged with

WinAPI : Working with Windows Handles

with 7 comments

We last saw how to get handles to the windows. Now once you got the handle you can call various functions to do a variety of jobs as getting information regarding the window, or changing the window’s state or style. Let’s see some of these functions.
Read the rest of this entry »

Written by Jalaj

January 29, 2007 at 5:40 am

Posted in Visual Basic, WinAPI

Tagged with

Getting Window Handles

with one comment

Previously we saw how to get handle to a window using a few commands. Windows have more API functions that facilates getting handle to windows in more complex or different situations. Listed here are a few of them.
Read the rest of this entry »

Written by Jalaj

January 28, 2007 at 10:56 am

Posted in Visual Basic, WinAPI

Tagged with

Windows and Handles

with 8 comments

In my last post we saw how to get the rectangle area occupied by a window given its handle. Now what is a handle and what exactly is a Window?
Read the rest of this entry »

Written by Jalaj

January 27, 2007 at 4:02 am

Posted in Visual Basic, WinAPI

Tagged with

RECT applied to Windows

with 2 comments

In my post Windows API functions for Rectangle we saw API functions related to RECT structure. As already discussed the RECT structure is important to Windows as all the Windows are rectangle and the Controls. Lets see here some functions that show relevance of RECT to windows.
Read the rest of this entry »

Written by Jalaj

January 26, 2007 at 4:50 am

Posted in Visual Basic, WinAPI

Tagged with

System Shutdown Windows API Functions

with 6 comments

Windows API provides access to many functions that are not available as in-built functions with Visual Basic. System shutdown functions are just few of them. Let’s get them one by one.
Read the rest of this entry »

Written by Jalaj

January 25, 2007 at 4:03 am

Posted in Visual Basic, WinAPI

Tagged with