WaitForProcess
Previous  Top  Next


Function WaitForProcess(ProcessID, TimeOutInMilliSeconds)

This function waits until the specified ProcessID has compeleted execution.

Parameters:

ProcessID  
[in] The processID to wait for completion. The process ID can come from ExecuteExternalProcess or ExecuteVirtualProcess  

TimeOutInMilliSeconds  
[in] The maximum amount of time to wait for the process to end before continuing. If 0 is specified, INFINITE is used  

Returns:
This function returns an integer  
0 = Timeout failed  
1 = Process exited  
2 = The process does not exists or security denied  

Example:
 
id = ExecuteExternalProcess("cmd.exe")  
WaitForProcess(id, 0)