Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Exe loses focus
Message
From
05/02/2003 01:04:09
 
 
To
05/02/2003 00:25:06
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Miscellaneous
Thread ID:
00748798
Message ID:
00749242
Views:
24
Pavel,

>With RUN command I can't do this:
>oProcess=CreateObject("API_AppRun","EXE with parameters","starting directory",..)
>Pavel

Yes you can:

If your main.exe sets its own default path when loading then its simply:
cMainExe = "main.exe Par1 Par2"  && Set up exe command with parameters list
RUN /N &cMainExe                 && Run exe without waiting
If your main.exe does not set its own path when loading then you can add the following path code:
cCurPath = SET("DEFAULT")        && Save current path setting
cMainExe = "main.exe Par1 Par2"  && Set up exe command with parameters

SET DEFAULT TO "X:\NEWFOLDER"    && Optional since main exe could set default path
RUN /N &cMainExe                 && Run exe without waiting
SET DEFAULT &cCurPath            && Restore to current path
IMO the main benefit from API_AppRun is: "...allows you to wait on termination or return immediately, and allows you to examine the execution status and termination code from an executable run by the class."
In the End, we will remember not the words of our enemies, but the silence of our friends - Martin Luther King, Jr.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform