Name

GetWindow

Synopsis

By first using the GetDesktopWindow or the FindWindow functions, you can obtain a handle that the GetWindow function can use to find a related window:

Public Declare Function GetWindow Lib "user32" Alias "GetWindow" _
		(ByVal hwnd As Long, ByVal wCmd As Long) As Long

Parameters

hwnd

The handle of a window used as a starting point.

wCmd

Defines the relationship between the window provided by the hwnd argument and the window handle to be returned by this function. Possible values of the wCmd parameter are described in greater detail below. The wCmd argument can contain any of the following values:

GW_CHILD (5)

The returned window handle is the first child window found in the Z-order.

GW_ENABLEDPOPUP (6)

The returned window handle is a pop-up window owned by the window represented by the hwnd argument. For Windows 2000 only.

GW_HWNDFIRST (0)

The returned window handle is the first in the Z-order with the same window type (topmost, top-level, or child) as the window represented by the hwnd argument.

GW_HWNDLAST (1)

The returned window handle is the last in the Z-order with the same window type (topmost, top-level, or child) as the window represented by the hwnd argument.

GW_HWNDNEXT (2)

The returned window handle is next in the Z-order with the same window type (topmost, top-level, or child) as the window represented by the hwnd argument.

GW_HWNDPREV (3)

The returned window handle is previous in the Z-order with the same window type (topmost, top-level, or child) ...

Get Subclassing and Hooking with Visual Basic now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.