Declare Function GetWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal wCmd As Long) As Long
Platforms: Win 32s, Win 95/98, Win NT
GetWindow returns the handle of a window related to a given window. The relations generally deal with child-parent relationships or relationships among children of the same parent window. The exact relation is specified by wCmd. If an error occurs or there is no window having the specified relation, the function instead returns 0.
Example:
' Flash the application's window that is below Form1 in the Z-order
' once.
Dim next As Long ' receives handle of next window in the Z-order
Dim retval As Long ' return value for flashing the window
next = GetWindow(Form1.hWnd, GW_HWNDNEXT) ' get the handle of the next window
If next <> 0 Then ' don't try to flags if no such window exists
' The next three lines flags the window once.
retval = FlashWindow(next, 1): Sleep 250
retval = FlashWindow(next, 1): Sleep 250
retval = FlashWindow(next, 0)
End If
See Also: GetActiveWindow, GetTopWindow
Category: Windows
Go back to the alphabetical Function listing.
Go back to the Reference section index.
This page is copyright © 2000 Paul Kuliniewicz. Copyright Information.
Go back to the Windows API Guide home page.
E-mail: vbapi@vbapi.com Send Encrypted E-Mail
This page is at http://www.vbapi.com/ref/g/getwindow.html