TaskNext and TaskFirst functions 
Author Message
 TaskNext and TaskFirst functions

-------------------------------------
I think, this is the wrong declaration
You'll better try Dim retc as INTEGER

Function IsInst(hInst As Long) As Boolean

    Dim taskstruct As TaskEntry

Quote:
>  Dim retc As Boolean

    Dim retc as integer
    IsInst = False
    taskstruct.dwSize = Len(taskstruct)
    retc = TaskFirst(taskstruct)

Quote:
>  Do While retc

    Do While retc <> 0

      If taskstruct.hInst = hInst Then
            ' note: the task handle is: taskstruct.hTask
            IsInst = True
            Exit Function
        End If
        retc = TaskNext(taskstruct)
    Loop

End Function

The results returned by the functions TaskFirst and TaskNext are
integer as well.

I use the following declaration:

Private Type TASKENTRY ' 40 bytes
    dwSize As Long
    hTask As Integer
    hTaskParent As Integer
    hInst As Integer
    hModule As Integer
    wSS As Integer
    wSP As Integer
    wStackTop As Integer
    wStackMinimum As Integer
    wStackBottom As Integer
    wcEvents As Integer
    hQueue As Integer
    szModule As String * 10
    wPSPOffSet As Integer
    hNext As Integer
End Type

Private Declare Function TaskFirst Lib "toolhelp.dll" (taskstruct As
TASKENTRY) as integer
Private Declare Function TaskNext Lib "toolhelp.dll" (taskstruct As
TASKENTRY) as integer



Sat, 17 Apr 1999 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. TaskNext and TaskFirst functions

2. TaskFirst and TaskNext functions - anyone get them to work?

3. API TASKNEXT VB 3.0

4. VB 3.0 API TASKNEXT

5. Running Excel function from Access function/macro

6. findlast function is not functioning?

7. new type of aggregate function (product function)

8. functions calling other functions

9. Function based on Function

10. Calling Function in CBF from Toolbar via a Public Function

11. Executing Function using String Containing Function Name

12. Function, function.

 

 
Powered by phpBB® Forum Software