0 out of 2 rated this helpful - Rate this topic

EnumThreadWindows function

Applies to: desktop apps only

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.

Syntax

BOOL WINAPI EnumThreadWindows(
  __in  DWORD dwThreadId,
  __in  WNDENUMPROC lpfn,
  __in  LPARAM lParam
);

Parameters

dwThreadId [in]

Type: DWORD

The identifier of the thread whose windows are to be enumerated.

lpfn [in]

Type: WNDENUMPROC

A pointer to an application-defined callback function. For more information, see EnumThreadWndProc.

lParam [in]

Type: LPARAM

An application-defined value to be passed to the callback function.

Return value

Type:

Type: BOOL

If the callback function returns TRUE for all windows in the thread specified by dwThreadId, the return value is TRUE. If the callback function returns FALSE on any enumerated window, or if there are no windows found in the thread specified by dwThreadId, the return value is FALSE.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

Reference
EnumChildWindows
EnumThreadWndProc
EnumWindows
Conceptual
Windows

 

 

Send comments about this topic to Microsoft

Build date: 2/3/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
C# syntax
[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
public static extern bool EnumThreadWindows(int dwThreadId, EnumThreadWindowsCallback lpfn, IntPtr lParam);
vb.net syntax
<DllImport("user32.dll", CharSet:=CharSet.Auto, ExactSpelling:=True)> _
Public Shared Function EnumThreadWindows(ByVal dwThreadId As Integer, ByVal lpfn As EnumThreadWindowsCallback, ByVal lParam As IntPtr) As Boolean End Function