Getting list of ICONS of current tasks 
Author Message
 Getting list of ICONS of current tasks

I know this isnt really the right place to ask, but my isp is being a bit
trippy and I cant get a list of any other groups.  So here goes.

What I want to do is display a list of icons of the currently open tasks.  At
the moment I am using GetWindow etc. and a timer (and drawiconex to draw the
icons at 64x64) to get everything, but the icons re-arrange themselves which is
anoying.

So I need an example of using Enum Windows or whatever it is and maybe also of
using a hook or something to refresh automatically ?  right idea?

Any help would be much appreciated

Chris Clough



http://www.*-*-*.com/



Sat, 07 Feb 2004 06:45:42 GMT  
 Getting list of ICONS of current tasks

Quote:
> I know this isnt really the right place to ask, but my isp is being a bit
> trippy and I cant get a list of any other groups.  So here goes.

> What I want to do is display a list of icons of the currently open tasks.
At
> the moment I am using GetWindow etc. and a timer (and drawiconex to draw
the
> icons at 64x64) to get everything, but the icons re-arrange themselves
which is
> anoying.

> So I need an example of using Enum Windows or whatever it is and maybe
also of
> using a hook or something to refresh automatically ?  right idea?

> Any help would be much appreciated

To enumerate all the child windows, use something like this:

'*** START CUT *** On a form:
Private Sub Form_Load()
    'Change "Form1.hwnd" to whatever window
    ' handle you want to down on
    EnumChildWindows Form1.hwnd, _
        AddressOf EnumChildProc, ByVal 0&

    If NumWnd = 0 Then
        Msgbox "No child windows detected on specified hWnd",. _
            vbExclamation, App.Title
    Else
        MsgBox NumWnd & " child window" & _
            IIf(NumWnd = 1, "", "s") & _
            " detected on specified hWnd", _
            vbInformation, App.Title
    End If
End Sub
'*** END CUT ***

'*** START CUT *** In a module:
Public Declare Function EnumChildWindows Lib _
    "user32" (ByVal hWndParent As Long, _
    ByVal lpEnumFunc As Long, _
    ByVal lParam As Long) As Long

Public WndList() As Long
Public NumWnd As Integer

'Enum child windows callback function
Public Function EnumChildProc(ByVal hwnd As Long, _
    ByVal lParam As Long) As Long
    'Store this hWnd in the list
    ReDim Preserve WndList(NumWnd) As Long
    WndList(NumWnd) = hwnd
    NumWnd = NumWnd + 1

    'Return 1 to continue enumeration
    EnumChildProc = 1
End Function
'*** END CUT ***

It will store the list of hWnd's in the WndList() array.
Hope this helps,

    Mike

 -- EDais --

WWW: Http://www20.Brinkster.com/EDais/




Sat, 07 Feb 2004 08:47:24 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Getting current task filename/path

2. Task List Icons

3. Different icons in Explorer and Task List?

4. How do I hide app icon but still show app in task list

5. Change ICON in task list??

6. removehandler: getting the list of current handlers

7. Getting active tasks list in VB

8. Getting Task List

9. Getting A Windows 95 Task List

10. Getting a Task List

11. Getting a list of Running Tasks in Windows 98

12. getting name of exe file from task list

 

 
Powered by phpBB® Forum Software