From: Galbu on
Hi all, is there any way to retrieve the hWnds of all the opened
windows? Plz help.. I'm getting crazy!!

From: David Jones on
Galbu wrote:
> Hi all, is there any way to retrieve the hWnds of all the opened
> windows?

If all you want are top-level windows, use EnumWindows.

What do you need this for? If EnumWindows isn't what you want, a
better description of the problem will help us suggest an appropriate
solution.

> Plz help.. I'm getting crazy!!

I don't think we can help you with that. Seek professional help.
j/k ;-)

David
From: Galbu on
I need to make something like the Windows' taskbar where all the
windows opened are listed.. so the top-level windows aren't enought..
but that's something

From: Kellie Fitton on
Hi,

You can work out this problem with a simple do-while loop, try
someThing like this:

GetTopWindow()
GetWindow()

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/gettopwindow.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/getwindow.asp

Hope these information helps,

Kellie.

From: David Jones on
Galbu wrote:
> I need to make something like the Windows' taskbar where all the
> windows opened are listed.. so the top-level windows aren't enought..
> but that's something
>
Correct me if I'm wrong, but isn't the taskbar a list of all
top-level windows?

If you really mean *all* windows (including all controls such as
edit boxes, static labels, and buttons and even including invisible
windows), you can use GetWindow like Kellie suggests, or you can
use EnumChildWindows. Is what you want similar to the Spy program
that's distributed with Visual Studio?

Your problem is still vague.... "all the windows opened" can mean
any of the following:

* top-level windows (visible in the taskbar)
* all popup windows (such as top-level + dialogs)
* all parent windows (such as windows that contain controls)
* all visible windows
* all windows in the system

Regardless, you're either going to need EnumWindows or
EnumChildWindows. It's either top-level or all, so if you need
something more than top-level, you need to filter out the ones
you want when you loop through all windows in the system. If
you state specifically what you want, we can recommend methods
of filtering out those windows, but right now I'm not sure what
to suggest.

BTW, you shouldn't really need GetTopWindow since it seems like
it's the same thing as GetWindow(..., GW_CHILD). Moreover, the
Get___ functions aren't as reliable as the Enum___ functions
according to MSDN, so I'd avoid GetWindow when you really want
to /enumerate/ windows. (Just my 2c - you can get it to work
either way, but with GetWindow you need to be more careful.)

David