EnumWindows, how to identify windows

  • Thread starter Thread starter Zamdrist
  • Start date Start date
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...
 
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
 
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
 
Back
Top