Code:
EnumDesktopWindows(hDesktop, EnumWindowsProc(), lParam);
EnumDesktopWindows takes a pointer to a function as its second argument. The template (not an actual C++ template) function for this is:
Code:
BOOL CALLBACK EnumWindowsProc(
__in HWND hwnd,
__in LPARAM lParam
);
(Source: EnumWindowsProc Function (Windows))
In other words, you must write a function (with whatever name you want) that returns type BOOL and takes a HWND and an LPARAM as arguments. I'm pretty sure that CALLBACK is just a define/typedef (can calling conventions be typedef'd?) for the calling convention, you're going to want it in there anyway. You then pass this function to EnumDesktopWindows.
For example:
Code:
BOOL CALLBACK MyEnumProc( HWND wnd, LPARAM lParam )
{
//do something with window here
}
int main( void )
{
EnumDesktopWindows( GetDesktopWindow(), MyEnumProc, 0 );
return 0;
}
Note that in my experience with EnumDesktopWindows, it only returns windows that are direct descendants of the desktop window.
This should probably be in the Windows Programming section.