Bekomme bei rProcess.aExeFile, ein blödsinn Raus!
Unter Delphi 2007 funktioniert es noch! Betriebsystem WinXP!
Delphi-Quellcode:
function IsProcess(ExeName: string): Boolean;
(*
** This routine examines Windows processes currently running to see if a
** certain program is running.
**
** sExe : The executable name of the program to check.
** Result: True if the program is running, False otherwise.
*)
var
liI, lSnapShot: Longint;
rProcess : TProcessEntry32;
begin
Result := False;
ExeName := UpperCase(ExeName);
lSnapShot := CreateToolHelpSnapShot(TH32CS_SNAPPROCESS, 0);
if lSnapShot <> 0 then begin
rProcess.iSize := SizeOf(rProcess);
liI := ProcessFirst(lSnapShot, rProcess);
while liI <> 0 do begin
if Pos(ExeName, UpperCase(rProcess.aExeFile)) <> 0 then begin
Result := True;
Break;
end;
liI := ProcessNext(lSnapShot, rProcess);
end;
CloseHandle(lSnapShot);
end;
end;
Hat wer eine Idee?