The GetActiveWindow function retrieves the window handle to the active window associated with the thread that calls the function.
HWND GetActiveWindow(VOID)
This function has no parameters.
The return value is the handle to the active window associated with the thread that calls the function. If the calling thread does not have an active window, the return value is NULL.