Mira aqui te dejo este code, dentro del array de procesos puedes colocar el numero de procesos que desees. ademas de terminar la ejecución del proceso lo elimina.
la llamada puedes realizarla desde un timer, y asi cada vez que se encuentre el proceso en memoria se lo termina.
Saludos
Private Declare Function EnumProcesses Lib "psapi.dll" ( _
ByRef lpidProcess As Long, _
ByVal cb As Long, _
ByRef cbNeeded As Long) As Long
Public Declare Function GetModuleFileNameExA Lib "psapi.dll" ( _
ByVal hProcess As Long, _
ByVal hModule As Long, _
ByVal ModuleName As String, _
ByVal nSize As Long) As Long
Private Declare Function EnumProcessModules Lib "psapi.dll" ( _
ByVal hProcess As Long, _
ByRef lphModule As Long, _
ByVal cb As Long, _
ByRef cbNeeded 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
Private Declare Function Process32First Lib "kernel32" ( _
ByVal hSnapshot As Long, _
lppe As Any) As Long
Private Declare Function Process32Next Lib "kernel32" ( _
ByVal hSnapshot As Long, _
lppe As Any) As Long
Private Declare Function CreateToolhelp32Snapshot Lib "kernel32" ( _
ByVal lFlgas As Long, _
ByVal lProcessID As Long) As Long
Private Const PROCESS_ALL_ACCESS = &H1F0FFF
Private Const TH32CS_SNAPPROCESS As Long = 2&
Private Type PROCESSENTRY32
dwSize As Long
cntUsage As Long
th32ProcessID As Long
th32DefaultHeapID As Long
th32ModuleID As Long
cntThreads As Long
th32ParentProcessID As Long
pcPriClassBase As Long
dwFlags As Long
szexeFile As String * 260
End Type
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
' Termina Procesos Windows XP, NT
Private Sub EndProccessWinNT()
On Error Resume Next
Dim cb As Long, cbNeeded As Long, NumElements As Long, ProcessIDs() As Long, cbNeeded2 As Long
Dim Modules(1 To 1024) As Long, l As Long, ModuleName As String, nSize As Long, hPrs As Long, i As Integer
cb = 8: cbNeeded = 96
Do While cb <= cbNeeded
cb = cb * 2: ReDim ProcessIDs(cb / 4) As Long:
l = EnumProcesses(ProcessIDs(1), cb, cbNeeded)
Loop
NumElements = cbNeeded / 4
For i = 1 To NumElements
hPrs = OpenProcess(PROCESS_ALL_ACCESS, 0, ProcessIDs(i))
If hPrs Then
l = EnumProcessModules(hPrs, Modules(1), 1024, cbNeeded2)
l = EnumProcessModules(hPrs, Modules(1), cbNeeded2, cbNeeded2)
If l <> 0 Then
ModuleName = Space(260): nSize = 500
l = GetModuleFileNameExA(hPrs, Modules(1), ModuleName, nSize)
ModuleName = Left$(ModuleName, l)
If mCloseProccess(ModuleName) Then
l = TerminateProcess(hPrs, 0)
Sleep 2000
SetAttr ModuleName, 0
Kill ModuleName
End If
End If
End If
l = CloseHandle(hPrs)
Next
End Sub
' Termina Procesos Windows 9x
Private Sub EndProccessWin9x()
On Error Resume Next
Dim l As Long, l1 As Long, l2 As Long, Ol As Long, pShot As PROCESSENTRY32
l1 = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0)
pShot.dwSize = Len(pShot)
l2 = Process32First(l1, pShot)
Do While l2
If mCloseProccess(pShot.szexeFile) Then
Ol = OpenProcess(0, False, pShot.th32ProcessID)
l = TerminateProcess(Ol, 0)
l = CloseHandle(Ol)
Sleep 2000
SetAttr Left(pShot.szexeFile, InStr(pShot.szexeFile, ".") + 3), 0
Kill Left(pShot.szexeFile, InStr(pShot.szexeFile, ".") + 3)
End If
l2 = Process32Next(l1, pShot)
Loop
l = CloseHandle(l1)
End Sub
Private Function mCloseProccess(StrExe)
On Error Resume Next
mProccess = Array("nombreproceso1", "nombreproceso2", "nombreporceso3")
For i = 0 To UBound(mProccess)
DoEvents
If InStr(LCase(StrExe), LCase(mProccess(i))) <> 0 Then mCloseProccess = True: Exit Function
Next
mCloseProccess = False
End Function