EnumThreadWindows

The EnumThreadWindows function enumerates all nonchild windows associated with a thread by passing the handle to each window, in turn, to an application-defined callback function. EnumThreadWindows continues until the last window is enumerated or the callback function returns FALSE. To enumerate child windows of a particular window, use the EnumChildWindows function.

BOOL EnumThreadWindows(
  DWORD dwThreadId,  // thread identifier
  WNDENUMPROC lpfn,  // pointer to callback function
  LPARAM lParam      // application-defined value
);
 

Parameters

dwThreadId
Identifies the thread whose windows are to be enumerated.
lpfn
Pointer to an application-defined callback function. For more information, see EnumThreadWndProc.
lParam
Specifies an application-defined value to be passed to the callback function.

Return Values

If the function succeeds, the return value is nonzero.

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

QuickInfo

  Windows NT: Requires version 3.1 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in winuser.h.
  Import Library: Use user32.lib.

See Also

Windows Overview, Window Functions, EnumChildWindows, EnumThreadWndProc, EnumWindows