home *** CD-ROM | disk | FTP | other *** search
- Option Explicit
-
- 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
-
- Declare Function TaskFirst% Lib "toolhelp.dll" (lpte As TASKENTRY)
- Declare Function TaskNext% Lib "toolhelp.dll" (lpte As TASKENTRY)
- Declare Function TaskFindHandle% Lib "toolhelp.dll" (lpte As TASKENTRY, hTask As Integer)
- Declare Function NotifyRegister% Lib "toolhelp.dll" (ByVal hTask%, ByVal lpfnCallback&, ByVal wFlags%)
- Declare Sub NotifyUnRegister Lib "toolhelp.dll" (ByVal hTask%)
- Global Const NF_NORMAL% = 0
- Global Const NF_TASKSWITCH% = 1
- Global Const NF_RIP% = 2
-
- Global Notifications$(13)
-
- '
- ' Return the name of the module
- '
- Function GetModuleName$ (lpte As TASKENTRY)
- Dim pos%
- pos% = InStr(lpte.szModule, Chr$(0))
- If pos% > 0 Then
- GetModuleName$ = Left$(lpte.szModule, pos% - 1)
- Else
- GetModuleName$ = ""
- End If
- End Function
-
-