Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Detecting external applications
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00647067
Message ID:
00666149
Vues:
24
Sergey,
Thank you for your suggestions.
I'm running FoxPro 2.6 for windows.
I've tried several things and the suggestion that seems to work best in my environment is to use the RUN w/o the /N
I was using the /N and a delay time but that didn't always work. I used the /N and set up a flag file and watched for its deletion, but that did not work as well as I'd hoped.... Having FoxPro 2.6 sitting in a loop checking FILE() took up too much of the processor time...it slowed things down...more than I liked.

But removing the /N seems to have done what I needed.
Thank you.
Rick
-------------------------------------
>>I need to be able to determine if a certain external application is done.
>>I have a FoxPro 2.6 program which calls an external (VFP) executable. But when it does this the program continues on to the next line of FoxPro 2.6 code. I really need to know when the VFP program has finished.
>>
>>I suppose the VFP program could create a file on the users SYS(2023) as the VFP program is closing, but I'd like a way to detect the running of the process.
>>
>>Is there any way I can do this?
>
>You didn't say if you are running DOS or Windows version of FoxPro 2.6. Either of them should wait for external program to finish if RUN command was used w/o /N switch (FPW). If it still doesn't wait even w/o /N switch or you don't want to use that switch, than you can try following:
>
>1. FPD 2.6 or FPW 2.6: Create a flag file at the start of VFP application and close at the end. In FP 2.6 check if you can open it. As long as it exists and you cannot open it, VFP app is still running.
>
>2. In FPW 2.6 you can call Win Api Findwindow function to check if VFP app is still running.
SET LIBRARY TO home()+"FOXTOOLS" ADDITIVE
>lnCall16 = RegFN("FindWindow", "L@C", "L")
>lcAppTitle = "My VFP Application"
>lnHWnd =  CallFN( lnCall16, 0, @lcAppTitle )
>IF lnHWnd > 0
>	* VFP application still running
>ENDIF
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform