The GetActiveWindow function retrieves the window handle to the active window associated with the calling thread's message queue.
HWND GetActiveWindow(VOID)
This function has no parameters.
The return value is the handle to the active window associated with the calling thread's message queue. Otherwise, the return value is NULL.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 1.0 or later.
Header: Declared in winuser.h.
Import Library: Use user32.lib.
Keyboard Input Overview, Keyboard Input Functions, SetActiveWindow