ProcessWait Function

Action

Waits for a running detached process.

Include file

Kernel.bdh

Syntax

ProcessWait(
     in hProc    : number,
     in nTimeout : number optional ): number;

Return value

If the function is successful, the status of the process is returned, which can be :

  • PROCESS_FINISHED (8) : The process has finished.

  • PROCESS_TIMED_OUT (-1) : The process is still running, timeout occured.

  • PROCESS_WAIT_FAILED (-2) : The process is not running, wrong handle etc.

Parameter Description
hProc The handle which identifies the process. The handle is returned by ProcessInitialize and must have been started by ProcessStart.
nTimeout Maximum wait time in milliseconds.
Note: ProcessWait must be called after ProcessStart and after ProcessInitialize.
Note: ProcessWait can be called more than once (for every environment variable).