Home > Language Reference > Windows Management Functions > GetTopWindowHandle

GetTopWindowHandle

The GetTopWindowHandle function returns the handle of the window on top.

Usage

Used to acquire dynamically the top window handle. This window handle can then be used in a UseWindowHandle statement.  

Syntax

handle=GetTopWindowHandle()

Parameters

None.

Return value

handle, integer, handle of the top window.

See also

GetFocusWindowHandle
GetWindowHandle
GetWindowName$
UseWindowHandle

Example

shell("notepad.exe")
pause 2
a=GetTopWindowhandle()
msgbox(a)
'a returns Notepad top window's handle.