
January 22nd, 2004, 08:40 AM
|
 |
I'm Internet Famous
|
|
Join Date: Jan 2003
Location: Toronto, Canada
Posts: 2,890
 
Time spent in forums: 1 Week 16 h 14 m 9 sec
Reputation Power: 8
|
|
Perhaps this will help:
Code:
Function IsProcessRunning(strProcess) As Boolean
Dim Process
IsProcessRunning = False
For Each Process In GetObject("winmgmts://").InstancesOf("win32_process")
If UCase(Process.Name) = UCase(strProcess) Then
IsProcessRunning = True
Exit Function
End If
Next
End Function
This will determine if a process is running.
It can be used as follows...
Code:
If IsProcessRunning("notepad.exe") = True Then
MsgBox "Process is running"
Else
MsgBox "Process is not running"
End If
That's the best to my knowledge right now...
try reading the MSDN as its helped me out greatly in the past
Here's a slight reference which may help you:
How to tell if a Shelled/Executed process has ended
|