给你参考这个;
'标准模块**************************************
Declare Function TerminateProcess Lib "kernel32" _
(ByVal hProcess As Long, _
ByVal uExitCode As Long) As Long
Declare Function OpenProcess Lib "kernel32" _
(ByVal dwDesiredAccess As Long, _
ByVal bInheritHandle As Long, _
ByVal dwProcessId As Long) As Long
Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Declare Function GetWindowThreadProcessId Lib "user32" _
(ByVal hwnd As Long, _
lpdwProcessId As Long) As Long
'*窗体模块***********************************************
Private Sub Form_Load()
Me.Show
Dim a As Long, PID As Long, b As Long, c
a = FindWindow(vbNullString, "QQ用户登录")'获得要结束程序的句柄
b = GetWindowThreadProcessId(a, PID)'获得进程PID
hProcess = OpenProcess(1, False, PID) 'PROCESS_TERMINATE;打开一个现有进程的句柄
TerminateProcess hProcess, 1'结束掉
End Sub