GetGUIThreadInfo

[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
);
 

Parameters

idThread
Value identifying the thread for which information is being retrieved. An application can retrieve this value by calling the GetWindowThreadProcessId Win32 function. Or, if you specify NULL for this parameter, the function returns information for the foreground thread.
lpgui
Address of a GUITHREADINFO structure that will contain information describing the thread. Before making the call, the cbSize member must be initialized in the program to the size of the GUITHREADINFO structure, in bytes.

Return Values

Returns TRUE if successful or FALSE otherwise.

Remarks

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.