This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Download Microsoft Edge
More info about Internet Explorer and Microsoft Edge
Examines the Z order of the child windows associated with the specified parent window and retrieves a handle to the child window at the top of the Z order.
Syntax
HWND GetTopWindow(
[in, optional] HWND hWnd
Parameters
[in, optional] hWnd
Type: HWND
A handle to the parent window whose child windows are to be examined. If this parameter is NULL, the function returns a handle to the window at the top of the Z order.
Return value
Type: HWND
If the function succeeds, the return value is a handle to the child window at the top of the Z order. If the specified window has no child windows, the return value is NULL. To get extended error information, use the GetLastError function.
Requirements