>>Yep - use my API_APPRUN class rather than run - it returns both a process handle and a thread handle that can be used to adjust the priority. Jusr use the LaunchApp() method and then grab the desired handle from the Process class instance and do your thing...
>
>Thanks; I believe this is exactly the class I needed, but I didn't remember where to find it.
>
>One more question: It seems to me that to combine the following two requirements: 1) Wait for termination, 2) Change the priority, I have to adapt the code in LaunchAppAndWait(). Is this correct, or is there a simpler way?
You can call LaunchApp(), snag the handle from the class instance and adjust the priority, and then have your VFP app poll for termination using the CheckProcessExitCode() method until it completes. You can even let your VFP app run side-by-side as long as it doesn't depend on the other process completing before continuing - I sometimes use this trick to launch a VFP report as a background job by firing it up as a separate .EXE and adjust its priority, letting it rip along in the background while my main app does something else...