Function Reference


ProcessWaitClose

Pauses script execution until a given process does not exist.

ProcessWaitClose ( "process" [, timeout = 0] )

Parameters

process The name or PID of the process to check.
timeout [optional] Specifies how long to wait (in seconds). Default is to wait indefinitely.

Return Value

Success: 1 and sets @extended to the exit code of the process.
Failure: 0 if the wait timed out. On invalid PID the @error flag is set to non-zero and @extended is set to 0xCCCCCCCC.

Remarks

Process names are executables without the full path, e.g., "notepad.exe" or "winword.exe"

PID is the unique number which identifies a Process. A PID can be obtained through the ProcessExists() or Run() commands.

The process is polled approximately every 250 milliseconds.

The return is 1 if the process was not existing.

Related

ProcessClose, ProcessExists, ProcessList, ProcessWait, RunAsWait, RunWait, WinGetProcess, WinWaitClose

Example

; Wait until no instance of Notepad exists.
ProcessWaitClose("notepad.exe")

; Wait until this particular instance of Notepad is closed by the user.
Local $iPID = Run("notepad.exe")
ProcessWaitClose($iPID)