Howdy all,
Hope this email finds everyone well.
Would anyone know how to check with ShellExecute has stopped?
I'm spawning a cmd box that's running a Blat script. However, I want VFP to stop processing until this window is finished\gone
A work around has been giving to me already:
> Put something in the final step of the batch file that creates a "flag"
> file and then check for the existence of that flag file in VFP. Don't
> forget to erase that flag file at the very beginning of the batch run so
> as to not get a false reading from a previous run.
>
What I would really like to do is something like the following:
DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, ;
STRING cAction, ;
STRING cFileName, ;
STRING cParams, ;
STRING cDir, ;
INTEGER nShowWin
DECLARE INTEGER GetWindowInfo IN user32;
INTEGER hwnd,;
STRING @ pwi
cAction = "open"
lnResult = ShellExecute( 0, cAction, tcFile, "", "", 2)
lnRunning = GetWindowInfo( lnWindow, pwi)
do while lnRunning > 0
lnRunning = GetWindowInfo( lnWindow, pwi)
enddo
NB: from
"If ShellExecute() succeeds, it returns an integer greater than 32. The integer is in fact the handle of the main window of the application which has been launched."
My problem is that lnRunning is always returning 0.
Any ideas?
Many thanks!
Cheers,
Garry
Hope this email finds everyone well.
Would anyone know how to check with ShellExecute has stopped?
I'm spawning a cmd box that's running a Blat script. However, I want VFP to stop processing until this window is finished\gone
A work around has been giving to me already:
> Put something in the final step of the batch file that creates a "flag"
> file and then check for the existence of that flag file in VFP. Don't
> forget to erase that flag file at the very beginning of the batch run so
> as to not get a false reading from a previous run.
>
What I would really like to do is something like the following:
DECLARE INTEGER ShellExecute IN shell32.dll ;
INTEGER hndWin, ;
STRING cAction, ;
STRING cFileName, ;
STRING cParams, ;
STRING cDir, ;
INTEGER nShowWin
DECLARE INTEGER GetWindowInfo IN user32;
INTEGER hwnd,;
STRING @ pwi
cAction = "open"
lnResult = ShellExecute( 0, cAction, tcFile, "", "", 2)
lnRunning = GetWindowInfo( lnWindow, pwi)
do while lnRunning > 0
lnRunning = GetWindowInfo( lnWindow, pwi)
enddo
NB: from
"If ShellExecute() succeeds, it returns an integer greater than 32. The integer is in fact the handle of the main window of the application which has been launched."
My problem is that lnRunning is always returning 0.
Any ideas?
Many thanks!
Cheers,
Garry