Einzelnen Beitrag anzeigen

Delphiturbo
(Gast)

n/a Beiträge
 
#5

Re: Programm (Prozessor) in dem Task-Manager beenden

  Alt 15. Mai 2008, 11:57
Delphi-Quellcode:
procedure KillProgram(ClassName: PChar; Titre: String);
const
PROCESS_TERMINATE = $0001;
var
ProcessHandle : THandle;
ProcessID: Integer;
Appli : HWND;
begin
Appli := FindWindow(PChar(ClassName), PChar(Titre));
GetWindowThreadProcessID(Appli, @ProcessID);
ProcessHandle := OpenProcess(PROCESS_TERMINATE, FALSE, ProcessId);
TerminateProcess(ProcessHandle,4);
end;
  Mit Zitat antworten Zitat