Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ShellExecute with Wait
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
01056067
Message ID:
01056087
Views:
38
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform