- Bool callback enumchildwindows (hwnd, lparam)
- {
- Char STR [1000];
- GetWindowText (hwnd, str, sizeof (str); // get the window title
- CString temp (str );
- AfxMessageBox (temp );
- GetClassName (hwnd, str, sizeof (str); // get the class name
- Temp = CString (str );
- AfxMessageBox (temp );
- Return TRUE;
- }
- Bool callback lpEnumWindows (HWND hwnd, LPARAM lParam)
- {
- Char str [1000];
- GetWindowText (hwnd, str, sizeof (str); // get the window title
- CString temp (str );
- AfxMessageBox (temp );
- GetClassName (hwnd, str, sizeof (str); // get the class name
- Temp = CString (str );
- AfxMessageBox (temp );
- EnumChildWindows (hwnd, EnumChildWindows, NULL); // obtain the subwindow (including controls)
- Return TRUE;
- }
- EnumWindows (lpEnumWindows, NULL); // start Enumeration
Bool enumwindows (wndenumproc lpenumfunc, lparam );
Parameters:
Lpenumfunc: pointer to the callback function defined by an application. For details, see enumwindowsproc.
Lpararm: Specifies an application definition value passed to the callback function.
Return Value: If the function succeeds, the return value is non-zero. If the function fails, the return value is zero. To obtain more error information, call the getlasterror function.
Note: The enumwindows function does not list subwindows.
Bool enumchildwindows (
Hwnd hwndparent, // handle to parent window // parent window handle
Wndenumproc lpenumfunc, // callback function address
Lparam // application-defined value // your own defined parameter
);