>Hello all,
>
>
>Im executing a Shell command that unzips some files which I downloaded from ftp. While the Shell runs asynchronously I want to stop the execution of my program until the Shell finishes executing.
>Is there any API functions which returns the status of Shell command?
What do you mean by a Shell command? If you mean you're using RUN to trigger an app that runs asynchrnously, yes, you can launch the application using the CreateProcess() API, which returns a process id and process handle, and you can track the progress of the spawned executable using CheckProcessExitCode(). This is the technique I use in API_APPRUN, which has a LaunchApp and a LaunchAppAndWait method, and can poll the process exit code to see if its still running, and if not, what the termination code is.
If you use a VFP RUN command, try API_APPRUN instead.
If you're launching indirectly using something that relies on the ShellExecute() API call, you'd need to rewrite the call to use ShellExecuteEx(), which also returns a process id and handle (the process handle returned by ShellExecute() is a pretty useless pseudohandle). You could then track execution progress using the same CheckProcessExitCode() API call.