تابعی برای بستن پروسس بر اساس آی دی پروسس
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, _
ByVal blnheritHandle As Long, ByVal dwAppProcessId As Long) As Long
Private Declare Function TerminateProcess Lib "kernel32" (ByVal ApphProcess As Long, _
ByVal uExitCode As Long) As Long
Public Sub EndProcessPerID(fProc As Long)
Dim mProcID As Long
mProcID = OpenProcess(1&, -1&, fProc)
TerminateProcess mProcID, 0&
End Sub

