WEB开发网
开发学院软件开发Delphi 杀死一个正在运行的程序 阅读

杀死一个正在运行的程序

 2006-02-04 13:34:44 来源:WEB开发网   
核心提示:PRocedure KillProgram(Classname : string; WindowTitle : string); const PROCESS_TERMINATE = $0001; var ProcessHandle : THandle; ProcessID: Integer; TheWindow : H
PRocedure KillProgram(Classname : string; WindowTitle : string);
const
 PROCESS_TERMINATE = $0001;
var
 ProcessHandle : THandle;
 ProcessID: Integer;
 TheWindow : HWND;
begin
 TheWindow := FindWindow(Classname, WindowTitle);
 GetWindowThreadProcessID(TheWindow, @ProcessID);
 ProcessHandle := OpenProcess(PROCESS_TERMINATE, FALSE, ProcessId);
 TerminateProcess(ProcessHandle,4);
end;

Tags:杀死 一个 正在

编辑录入:爽爽 [复制链接] [打 印]
赞助商链接