5 out of 12 rated this helpful - Rate this topic

EnumWindowsProc callback function

Applies to: desktop apps only

An application-defined callback function used with the EnumWindows or EnumDesktopWindows function. It receives top-level window handles. The WNDENUMPROC type defines a pointer to this callback function. EnumWindowsProc is a placeholder for the application-defined function name.

Syntax

BOOL CALLBACK EnumWindowsProc(
  __in  HWND hwnd,
  __in  LPARAM lParam
);

Parameters

hwnd [in]

A handle to a top-level window.

lParam [in]

The application-defined value given in EnumWindows or EnumDesktopWindows.

Return value

To continue enumeration, the callback function must return TRUE; to stop enumeration, it must return FALSE.

Remarks

An application must register this callback function by passing its address to EnumWindows or EnumDesktopWindows.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winuser.h (include Windows.h)

See also

Reference
EnumWindows
Conceptual
Windows
Other Resources
EnumDesktopWindows

 

 

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
Dont forget to push registers!
If you use a really native programming language like native profan functions with xpse or asm, be sure to push all registers at function-start and pop all registers at function-end or you can get a lot of trouble.

In example (32bit) this does not work:
nProc FindWindow.EnumWindowsProc(long wnd,lp){
    string s=space(260)
    long r=GetWindowText(wnd,s,260)  
    casenot r : return true
    MessageBox(,s,,)  
    return true
}
But this works fine:
nProc FindWindow.EnumWindowsProc(long wnd,lp){
    PushAll     string s=space(260)     long r=GetWindowText(wnd,s,260)     ifnot r {         PopAll         return true     }     MessageBox(,s,,)     PopAll     return true }