EnumChildWindows

Syntax

BOOL EnumChildWindows(hWndParent,lpEnumFunc,lParam)

This function enumerates the child windows that belong to the specified parent window by passing the handle of each child window, in turn, to the application-supplied callback function pointed to by the lpEnumFunc parameter.

The EnumChildWindows function continues to enumerate windows until the called function returns zero or until the last child window has been enumerated.

Parameter Type/Description  

hWndParent HWND Identifies the parent window whose child windows are to be enumerated.  
lpEnumFunc FARPROC Is the procedure-instance address of the callback function.  
lParam DWORD Specifies the value to be passed to the callback function for the application's use.  

Return Value

The return value specifies nonzero if all child windows have been enumerated.
Otherwise, it is zero.

Comments

This function does not enumerate pop-up windows that belong to the hWndParent
parameter.

The address passed as the lpEnumFunc parameter must be created by using the
MakeProcInstance
function.

The callback function must use the Pascal calling convention and must be declared FAR.

Callback Function

BOOL FAR PASCAL EnumFunc(hWnd, lParam)
HWND hWnd;
DWORD lParam;

EnumFunc is a placeholder for the application-supplied function name. The actual name must be exported by including it in an EXPORTS statement in the application's module-definition file.

Parameter Description  

hWnd Identifies the window handle.  
lParam Specifies the long parameter argument of the EnumChildWindows function.  

Return Value

The callback function should return a nonzero value to continue enumeration; it should return zero to stop enumeration.