Private Declare Function TerminateProcess Lib "kernel32" _
(ByVal hProcess As Long, ByVal uExitCode As Long) As Long
Const PROCESS_QUERY_INFORMATION = &H400
Private hProcess As Long
-----------------在程序中------------------
Dim pid As Long
pid = Shell("notepad.exe", vbNormalFocus)
hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, 0, pid)
----------------如果要关闭-----------------
If hProcess <> 0 Then
aa = TerminateProcess(hProcess, 3838)
End If
***********************************************************************************************************
ExitProcess
VB声明
Declare Sub ExitProcess Lib "kernel32" Alias "ExitProcess" (ByVal uExitCode As Long)
说