>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
> 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