Private Declare Function OpenProcess Lib "Kernel32" (Byval Binherithand AS Long, Byval dwprocessid As long) As long
Private Declare Function CloseHandle Lib "Kernel32" (Byval Hobject As Long) AS Long
Private const process_query_information = & h400
'Parameters: Process IDFunction IsProcessIsRun (ByVal PID As Long) As Boolean Dim hProcess As Long hProcess = OpenProcess (PROCESS_QUERY_INFORMATION, 0 &, PID) If hProcess = 0 Then IsProcessIsRun = False Exit Function End If Call CloseHandle (hProcess) IsProcessIsRun = TrueEnd Function