Tomazaz
asked on
Somethign wrong with Openprocess
Hello,
I use function below to determinate is process is running or it is already terminated. While passing process ID as parameter it works perfect on WindowsXP, unfortunately it does not work on processes which was run by SYSTEM on Windows 2003. Function always return FALSE
through process is running.
function ProcessExists(PID: Cardinal): Boolean;
var
x: THandle;
begin
result := false;
x := Openprocess(PROCESS_ALL_AC CESS, false, PID);
if x <> 0 then
begin
result := true;
CloseHandle(x);
end;
end;
Regards,
Tomas
I use function below to determinate is process is running or it is already terminated. While passing process ID as parameter it works perfect on WindowsXP, unfortunately it does not work on processes which was run by SYSTEM on Windows 2003. Function always return FALSE
through process is running.
function ProcessExists(PID: Cardinal): Boolean;
var
x: THandle;
begin
result := false;
x := Openprocess(PROCESS_ALL_AC
if x <> 0 then
begin
result := true;
CloseHandle(x);
end;
end;
Regards,
Tomas
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.