Determine whether the process of the specified process number exists

xiaoxiao2021-03-06  25

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

转载请注明原文地址:https://www.9cbs.com/read-40599.html

New Post(0)