The WaitProcess Method of the Generic ActiveX Object waits for the process started by LaunchProcessNonBlocking to terminate or time out.
WaitProcess (Method of the Generic ActiveX Object) Syntax var bRetVal = objGeneric.WaitProcess(hProcessHandle, TimeoutValue);
Items listed in this section indicate parameters, or attributes which can be set.
Name Possible Values Description
Default Value hProcessHandle Handle Handle returned by LaunchProcessNonBlocking N/A TimeoutValue Seconds Time to wait before method times out. A value of 0 will return immediately and can be used to determine if the process has completed or not. N/A
Name Description bRetVal True if the process terminated or False if the timeout expired.
<script> var objGeneric = new ActiveXObject("PocketBrowser.Generic"); var hProcess = objGeneric.LaunchProcessNonBlocking('\\application\\ctlpanel.exe', ''); // Give the user 5 seconds to quit the process var bRetVal = objGeneric.WaitProcess(hProcess, 5); if (bRetVal) alert('Process Ended by User'); else alert('Process Still Running'); objGeneric.CloseProcess(hProcess); </script>
Copy example to clipboard
Supported Platforms Windows CE, Windows Mobile Persistence Runs instantly. Min. Requirements None.