mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 20:09:25 +02:00
* WaitOnExit now returns a boolean
git-svn-id: trunk@5576 -
This commit is contained in:
parent
968f44d0b4
commit
e4fb3f71d3
@ -101,7 +101,7 @@ Type
|
||||
Function Resume : Integer; virtual;
|
||||
Function Suspend : Integer; virtual;
|
||||
Function Terminate (AExitCode : Integer): Boolean; virtual;
|
||||
Function WaitOnExit : DWord;
|
||||
Function WaitOnExit : Boolean;
|
||||
Property WindowRect : Trect Read GetWindowRect Write SetWindowRect;
|
||||
Property Handle : THandle Read FProcessHandle;
|
||||
Property ProcessHandle : THandle Read FProcessHandle;
|
||||
|
@ -101,9 +101,10 @@ Function Terminate (AExitCode : Integer): Boolean; virtual;
|
||||
exitcode 'AExitCode'
|
||||
It returns True on succes, False on failure.
|
||||
|
||||
Function WaitOnExit : Integer;
|
||||
This function returns immediatly if the application is not running,
|
||||
and waits for the application to finish if it was still running.
|
||||
Function WaitOnExit : Boolean;
|
||||
This function returns true if the wait for the process exit was succesful,
|
||||
false if some error occurded. It returns immediatly if the application is
|
||||
not running, and waits for the application to finish if it was still running.
|
||||
|
||||
Property ApplicationName : String;
|
||||
Sets the name of the application.
|
||||
|
@ -340,12 +340,16 @@ begin
|
||||
WaitOnExit;
|
||||
end;
|
||||
|
||||
Function TProcess.WaitOnExit : Dword;
|
||||
Function TProcess.WaitOnExit : Boolean;
|
||||
|
||||
Var
|
||||
R : Dword;
|
||||
|
||||
begin
|
||||
Result:=fpWaitPid(Handle,pcint(@FExitCode),0);
|
||||
If Result=Handle then
|
||||
FExitCode:=WexitStatus(FExitCode);
|
||||
R:=fpWaitPid(Handle,pcint(@FExitCode),0);
|
||||
Result:=(R=Handle);
|
||||
If Result then
|
||||
FExitCode:=WExitStatus(FExitCode);
|
||||
FRunning:=False;
|
||||
end;
|
||||
|
||||
|
@ -213,11 +213,15 @@ begin
|
||||
WaitOnExit;
|
||||
end;
|
||||
|
||||
Function TProcess.WaitOnExit : Dword;
|
||||
Function TProcess.WaitOnExit : Boolean;
|
||||
|
||||
Var
|
||||
R : DWord;
|
||||
|
||||
begin
|
||||
Result:=WaitForSingleObject (FProcessHandle,Infinite);
|
||||
If Result<>Wait_Failed then
|
||||
R:=WaitForSingleObject (FProcessHandle,Infinite);
|
||||
Result:=(R<>Wait_Failed);
|
||||
If Result then
|
||||
GetExitStatus;
|
||||
FRunning:=False;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user