var
h,a:THandle;
ID:是要杀死进程的ID
h:=openprocess(PROCESS_ALL_ACCESS,True,Id);
getExitCodeProcess(h,a);
if terminateProcess(h,a) then
begin
Showmessage('进程已关闭!');
BOOL TerminateProcess(
HANDLE hProcess, // handle to the process
UINT uExitCode // exit code for the process
);
或者
VOID ExitProcess(
UINT uExitCode // exit code for all threads
);