[This is preliminary documentation and subject to change.]
Retrieves information about the active window or a specified graphical user interface (GUI) thread.
BOOL WINAPI GetGUIThreadInfo(
DWORD idThread,
LPGUITHREADINFO lpgui
);
Returns TRUE if successful or FALSE otherwise.
This function succeeds even if the active window is not owned by the caller's process. If the specified thread does not exist or have an input queue, the function will fail.
This function is useful for retrieving out-of-context information about a thread. The information retrieved is the same as if an application retrieved the information for itself using the Win32 functions GetFocus, GetCapture, and so on.