Platform SDK: DLLs, Processes, and Threads

GetGuiResources

The GetGuiResources function retrieves the count of handles to graphical user interface (GUI) objects in use by the specified process.

DWORD GetGuiResources (
  HANDLE hProcess,  // handle to process
  DWORD uiFlags     // GUI object type
);

Parameters

hProcess
[in] Handle to the process. The handle must have the PROCESS_QUERY_INFORMATION access right. For more information, see Process Security and Access Rights.
uiFlags
[in] Specifies the GUI object type. This parameter can be one of the following values.
Value Meaning
GR_GDIOBJECTS Return the count of GDI objects.
GR_USEROBJECTS Return the count of USER objects.

Return Values

If the function succeeds, the return value is the count of handles to GUI objects in use by the process. If no GUI objects are in use, the return value is zero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

A process without a graphical user interface does not use GUI resources, therefore, GetGuiResources will return zero.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Unsupported.
  Header: Declared in Winuser.h; include Windows.h.
  Library: Use User32.lib.

See Also

Processes and Threads Overview, Process and Thread Functions, CreateProcess, GetCurrentProcess, OpenProcess