Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ShellExecute with Wait
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
01056067
Message ID:
01056087
Vues:
39
This message has been marked as a message which has helped to the initial question of the thread.
>Hi!
>
>How can I get the windows ShellExecute() API to force a wait so that it waits till the ShellExecute() function finishes and only then processes the next record.?
>
>Is there a parameter I can pass to ShellExecute to make it Run and Wait?
>
>
>
>e.g.
>DECLARE INTEGER ShellExecute IN shell32.dll ;
>  INTEGER lhndWin, ;
>  STRING lcAction, ;
>  STRING lcFileName, ;
>  STRING lcParams, ;
>  STRING lcDir, ;
>  INTEGER lnShowWin
>
>lcAction = "open"
>
>Select (MyAlias)
>Scan
>   lcFileName = MyAlias.FileName && "c:\MyBatchFile.bat"
>   If ShellExecute(0, cAction, cFileName, "", "", 2) > 32 then
>      *-- Success
>   Else
>      *-- Error
>   Endif
>   *-- Want to wait till the above ShellExecute() function
>   *-- finishes and only then process the next record.
>Endscan
>
>
>
>Thanks.
>
Sarosh,

You might want to look at the Run App and Wait information the late Ed Rauh posted here. Additionally, he and I wrote a series of articles about the Windows Script Host that appeared in the VFUG newsletters a few years back. The WScript.Shell object has a run method that allows for this.
George

Ubi caritas et amor, deus ibi est
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform