晚了~~~<br>Function KillProcess(ProexeName: String): Integer;<br>Var<br> ok: BOOL;<br> ProcessListHandle: THandle; //进程列表的句柄<br> processStruct: TProcessEntry32; //进程的结构,进程的信息都在这个结构里<br> h: Thandle;<br> a: DWORD;<br>Begin<br> result := 0;<br> processListHandle := CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);<br> ProcessStruct.dwSize := Sizeof(ProcessStruct);<br> ok := Process32First(ProcessListHandle, ProcessStruct);<br> While integer(ok) <> 0 Do<br> Begin<br> If Uppercase(ProcessStruct.szExeFile) = Uppercase(ProexeName) Then<br> Begin<br> h := openprocess(PROCESS_ALL_ACCESS, TRUE, ProcessStruct.th32ProcessID);<br> GetExitCodeProcess(h, a);<br> If Integer(TerminateProcess(h, a)) <> 0 Then<br> result := result + 1;<br> End;<br> ok := Process32Next(ProcessListHandle, ProcessStruct);<br> End;<br>End;