Retrieving names from Taskbar

Vinx
09-06-2003, 06:11 PM
Is there a way I can have an array called aTaskbar() and get the names of all the programs open through the taskbar and store them in the array?

Squirm
09-06-2003, 06:15 PM
Start off with EnumWindows, then for each returned window handle call GetWindowLong to check for the WS_EX_APPWINDOW extended style bit. If it is present in the extended styles, use GetWindowTextLength and GetWindowText to retrieve the window caption. Voila.

Vinx
09-06-2003, 06:44 PM
I got the EnumWindow function to return all handles/names in an array called aHandles(). Then I sorta lost you...I don't understand the other three functions and what to do with them. Could you sort of explain how I should use them?

Squirm
09-06-2003, 07:12 PM
Given a window handle X:

'GWL_EXSTYLE = (-20)
'WS_EX_APPWINDOW = &H40000
If (GetWindowLong(X, GWL_EXSTYLE) And WS_EX_APPWINDOW) Then
'Its on the taskbar!
End If

Examples of the correct usage of GetWindowTextLength and GetWindowText can be found via the links in my previous post.

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum