I am looking for a window in which its class name is "CLIPBRDWNDCLASS" (it can be found in office applications and other applications).
If I use FindWindow or FindWindowEx, I find the first HWND that has this class, but I want all the windows with this class, so I decided to use the recursive EnumChildWindows to list all the windows and search for the window that I want:
//------------------------------------------------------------------------------- BOOL CALLBACK enum_wnd_proc(HWND h, LPARAM lp) { char cls[1024] = {0}; ::GetClassNameA(h, cls, 1024); if(std::string(cls) == "CLIPBRDWNDCLASS") { // match! } ::EnumChildWindows(h, enum_wnd_proc, NULL); return TRUE; } //------------------------------------------------------------------------------- int _tmain(int argc, _TCHAR* argv[]) { ::EnumWindows(enum_wnd_proc, NULL); return 0; } //-------------------------------------------------------------------------------
This is that this window does not return to EnumWindows, only with FindWindow.
Can anyone tell me why it is not working?
source share