Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Exe loses focus
Message
De
05/02/2003 01:04:09
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Titre:
Divers
Thread ID:
00748798
Message ID:
00749242
Vues:
25
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform