Tutorial :C++ Multi Monitor - Find All Visible/Open Windows


I'm trying to find all the windows of ANY kind that are open (and have a taskbar 'button').

I have no problems finding the list processes/hWnd's, and then cycling through those, but how do I determine if a process/hwnd has a window open? (even if minimized).

I've tried doing different combinations of the window parameters (such as WS_POPUP etc) but none of the parameters (or combinations of parameters) that I could find would give me all the open windows without some sort of false positives. As an example of a false positive was the fact that it gives me two 'windows' for google talk (even though one was open). Another false positive is considering the start menu as an open window.

Any ideas? Solutions? I've been working on this for a while and its been driving me a bit insane.

Note: I'm doing this for windows 7 (at this point). I'm not sure if there's any difference between how you would do this between XP and 7, but I thought it might be relevant.


Can you use EnumWindows()? That finds only toplevel windows.

EnumWindows (MSDN)

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »