这是如何关闭的例子
Private Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccess As Long, ByVal bInheritHandle As Long, ByVal dwProcessId As Long) As Long
Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long
Dim ret
Private Sub Command1_Click()
ret = Shell("c:\windows\notepad.exe", 1)
End Sub
Private Sub Command2_Click()
Dim x As Long
x = OpenProcess(0, False, ret)
Dim ret2 As Long
ret2 = TerminateProcess(x, 0)
ret2 = CloseHandle(x)
End Sub