Quote Originally Posted by Edgemeal View Post
Code:
Option Explicit
Private Declare Function OpenProcess Lib "kernel32" (ByVal dwDesiredAccessas As Long, ByVal bInheritHandle As Long, ByVal dwProcId As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal handle As Long) As Long
Private Declare Function TerminateProcess Lib "kernel32" (ByVal hProcess As Long, ByVal uExitCode As Long) As Long

Public Function KillProcess(ByVal ProcessID As Long) As Boolean
    Dim hProc As Long
    Const SYNCHRONIZE = &H100000
    Const PROCESS_TERMINATE As Long = &H1
    Const fdwAccess As Long = SYNCHRONIZE Or PROCESS_TERMINATE
    hProc = OpenProcess(fdwAccess, 0&, ProcessID)
    If hProc Then
        If TerminateProcess(hProc, 0&) Then KillProcess = True
        Call CloseHandle(hProc)
    End If
End Function
Thanks for the code...