|
-
December 2nd, 2006, 06:37 PM
#1
EnumWindows API
Hi all,
I am trying to find the names of all the opened Windows.
I am using EnumWindows API, and I am at the point that I can print bunch of Window titles; however, it's printing much more than I wanted.
For example, I have winamp, visual stuido, 1 internet explore open. The program printed out the 3 things above, but it's also printing things like:
&File
&File
&File
&File
&File
AutoHide
AutoCompleteProxy
ccApp
etc
.
.
.
Am I using a wrong function for what I want to do?
Thanks,
opiston
-
December 2nd, 2006, 11:48 PM
#2
Re: EnumWindows API
Could you post some code please it could help.
The first thing that jumps into my head is to run a check on the following in your callback function.
Code:
if (!IsWindowVisible(hWnd))
return TRUE;
Tom
-
December 3rd, 2006, 02:53 AM
#3
Re: EnumWindows API
Hi zeRoau,
I put your code into the callback function and it's working as it should now.
Thank you for your help.
opiston
-
December 4th, 2006, 01:28 PM
#4
Re: EnumWindows API
 Originally Posted by opiston
...it's working as it should now...
Just a quick note - it DID work as it should in the first place, only you didn't know that EnumWindows enumerates hidden windows too...
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
-
December 5th, 2006, 11:19 PM
#5
Re: EnumWindows API
Hey VladimirF,
How's going?
 Originally Posted by VladimirF
Just a quick note - it DID work as it should in the first place, only you didn't know that EnumWindows enumerates hidden windows too... 
Yeah, I thought EnumWindows only enumerate the visible windows. I guess I should have said, "It's working as I want it to" =))
Here is the definition of EnumWindows from MSDN:
The EnumWindows function enumerates all top-level windows on the screen by passing the handle to each window, in turn, to an application-defined callback function. EnumWindows continues until the last top-level window is enumerated or the callback function returns FALSE.
I guess I mis-understood top-level windows.
So what is top-level windows then?
Thank you,
opiston
-
December 6th, 2006, 01:01 PM
#6
Re: EnumWindows API
 Originally Posted by opiston
So what is top-level windows then?
Windows that have the Desktop Window as a parent
Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
Convenience and productivity tools for Microsoft Visual Studio:
FeinWindows - replacement windows manager for Visual Studio, and more...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|