EnumWindows, how to identify windows

Z

Zamdrist

I can return a list of windows and their titles using the API,
AddressOf & Callbacks, however I get all programs/processes like GDI+,
DDE Server, etc. I really just want the programs opened in the
taskbar, such as Outlook, Query Analyzer (whatever)...How can I fliter
the list?

I was hoping to use this, but if there is another method I'd like to
know.

Private Declare Function IsWindowVisible Lib "user32" _
(ByVal hwnd As IntPtr) As Long

This returns such things as:

8975933078237085696
8975933078237085697
8975933078237085697
8975933078237085696
8975933078237085696
8975933078237085697

Incidently, the ones ending in 97 are 'user program windows' if you
will. Thanks...
 
M

Mattias Sjögren

How can I fliter the list?

You can find some details about how the taskbar does its selection
under the Managing Taskbar Buttons section here

http://msdn2.microsoft.com/en-us/library/aa969325.aspx

You basically have to do the same. Look at the window style bits etc.

I was hoping to use this, but if there is another method I'd like to
know.

Private Declare Function IsWindowVisible Lib "user32" _
(ByVal hwnd As IntPtr) As Long

This returns such things as:

8975933078237085696

The return type should be a Boolean, not a Long.


Mattias
 
Z

Zamdrist

The return type should be a Boolean, not a Long.

Mattias

Thank you Mattias, that was helpful. Changing the function to return
Boolean allowed me to test against it and filter out the unwanted
processes from the user programs.

Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top