GetActiveWindow
The GetActiveWindow function retrieves the window handle to the active window attached to the calling thread's message queue.
HWND GetActiveWindow(VOID);
Parameters
This function has no parameters.
Return Values
The return value is the handle to the active window attached to the calling thread's message queue. Otherwise, the return value is NULL.
Remarks
To get the handle to the foreground window, you can use GetForegroundWindow.
Windows 98/Me and Windows NT 4.0 SP3 and later: To get the window handle to the active window in the message queue for another thread, use GetGUIThreadInfo.