Tlhelp32;<br>function KillTask(ExeFileName: string): Integer;<br><br>const<br><br>PROCESS_TERMINATE = $0001;<br><br>var<br><br>ContinueLoop: BOOL;<br><br>FSnapshotHandle: THandle;<br><br>FProcessEntry32: TProcessEntry32;<br><br>begin<br><br>Result := 0;<br><br>FSnapshotHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);<br><br>FProcessEntry32.dwSize := SizeOf(FProcessEntry32);<br><br>ContinueLoop := Process32First(FSnapshotHandle, FProcessEntry32);<br><br>while Integer(ContinueLoop) <> 0 do<br><br>begin<br><br>if ((UpperCase(ExtractFileName(FProcessEntry32.szExeFile)) =<br><br>UpperCase(ExeFileName)) or (UpperCase(FProcessEntry32.szExeFile) =<br><br>UpperCase(ExeFileName))) then<br><br>Result := Integer(TerminateProcess(<br><br>OpenProcess(PROCESS_TERMINATE,<br><br>BOOL(0),<br><br>FProcessEntry32.th32ProcessID),<br><br>0));<br><br>ContinueLoop := Process32Next(FSnapshotHandle, FProcessEntry32);<br><br>end;<br><br>CloseHandle(FSnapshotHandle);<br><br>end;<br><br><br>用这个改一下就可以了