Function Reference


_WinAPI_GetForegroundWindow

Returns the handle of the foreground window

#include <WinAPI.au3>
_WinAPI_GetForegroundWindow ( )

Return Value

Success: Handle of the foreground window
Failure: The foreground window can be NULL in certain circumstances, such as when a window is losing activation

See Also

Search GetForegroundWindow in MSDN Library.

Example

#include <MsgBoxConstants.au3>
#include <WinAPI.au3>

MsgBox($MB_SYSTEMMODAL, "Handle", "Get Foreground Window: " & _WinAPI_GetForegroundWindow())