Group: Window - Library: user32
Retrieveing information about the active window (even if it is not owned by the calling process)
BOOL GetGUIThreadInfo(
DWORD idThread,
LPGUITHREADINFO lpgui
);
DECLARE INTEGER GetGUIThreadInfo IN user32;
INTEGER idThread,;
STRING @ lpgui
idThread [in] Identifies the thread for which information is to be retrieved.
lpgui [out] Pointer to a GUITHREADINFO structure that receives information describing the thread.
If the function succeeds, the return value is nonzero.
MSDN: This function succeeds even if the active window is not owned by the calling 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 about itself.