Returns the handle of the foreground window
#include <WinAPISysWin.au3>
_WinAPI_GetForegroundWindow ( )
Success: | Handle of the foreground window |
Failure: | The foreground window can be NULL in certain circumstances, such as when a window is losing activation |
Search GetForegroundWindow in MSDN Library.
#include <MsgBoxConstants.au3>
#include <WinAPISysWin.au3>
MsgBox($MB_SYSTEMMODAL, "Handle", "Get Foreground Window: " & _WinAPI_GetForegroundWindow())