需要得到进程ID:
procedure KillProcess(dwProcessId: DWORD);
var
ProcHandle: THandle;
begin
ProcHandle := OpenProcess(1, FALSE, dwProcessID);
try
if ProcHandle <> 0 then
begin
if TerminateProcess(ProcHandle, $FFFFFFFF) then
WaitForSingleObject(ProcHandle, INFINITE);
end;
finally
CloseHandle(ProcHandle);
end;
end;