Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to use ShellExecute to run a DOS progarm ?
Message
De
24/04/2013 03:52:29
 
 
À
24/04/2013 03:30:39
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01571708
Message ID:
01571716
Vues:
53
>Hi,
>Then, how can I control the dos program run finish and return back to calling point and continue other
>processing ?
>
>Regards,
>Derek

You can let the dos program create a file, and check for that file. Or if you can try this code, which I have copied from one of my own programs. The program returns .T. as long as the named program runs. You can create a loop or a timer and check when it will return .F.
Lparameters tcProgram
Local loShell As [Shell.Application]
Local lcProgram, llAlredyup, loIE, loShellWindows, lox
m.loShell = Createobject([Shell.Application])
m.lcProgram = Upper(m.tcProgram)
m.loShellWindows = m.loShell.Windows
For Each m.loIE In m.loShellWindows
   If m.lcProgram == Justfname(Upper(m.loIE.FullName))
      m.lox = m.loIE
      m.llAlredyup = .T.
      Exit
   Endif
Endfor
Return m.llAlredyup
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform