>>SET CLASSLIB TO PROCESS
>>oAppTORun = CREATEOBJ('API_APPRUN',"doscommand",,'MIN') && run minimized
>>oAppToRun.LaunchAppAndWait()
>>oAppToRun= NULL
>
>thanks Ed and I Knew it I have seen this class somewhere..now
>>oAppToRun.LaunchAppAndWait()
>will this tell me when the application has finished executing or the DOS window
>disspaear?? kind like if it is > 0 or something then the app has finished??
>
This will make your VFP app pause until the other application terminates. If you use the LaunchApp method instead, control will then be returned to VFP immediately. You app could then poll the termination status of the other application using the CheckProcessExitCode method; the other app will have terminated when CheckProcessExitCode returns a value other than 259.
LaunchAppAndWait returns a logical; .T. means that the app ran to completion, and .F. means either that the app failed to start, or you aborted waiting on termination by pressing Escape when VFP had focus, and the program is still running. If .F. is returned, you can examine the icErrorMessage property to find out what the class thought had happened.