你参考一下吧,我也不知道怎么解释,以前找的
l = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)
If l Then
my.dwSize = 1060
If (Process32First(l, my)) Then
'遍历第一个进程
Do
'
Set mlistitem = ListView1.ListItems.Add(, , my.th32ProcessID)
'
mlistitem.SubItems(1) = my.th32ParentProcessID
' mlistitem.SubItems(2) = my.szExeFile
i = InStr(1, my.szExeFile, Chr(0))
mName = LCase(Left(my.szExeFile, i - 1))
If aa >= 2 Then
'Unload Me
End
Else
If mName = "aip.exe" Then
'MsgBox aa
aa = aa + 1
End If
End If
Loop Until (Process32Next(l, my) < 1)
'遍历所有进程知道返回值为False
If aa > 1 Then
Timer1.Enabled = True
Timer2.Enabled = True
Exit Sub
End If
End If
l1 = CloseHandle(l)
End If