> The following might be useful in keeping the run command window in the
> background in Visual Foxpro:
>
> Do DosRun with ""
>
> FUNCTION DosRun
> PARAMETER doscmd
>
> DECLARE INTEGER WinExec IN win32api AS run ;
> STRING command, INTEGER param
>
> cmdstart = SYS(2004) + "FOXRUN.PIF /C "
> fullcmd = cmdstart + doscmd
> retval = run(fullcmd,0)
> Return retval
>
> It may not be the most efficient but it works.
Let's modify this just a bit to make it quite a bit more efficient and
useful:
Do DosRun with ""
FUNCTION DosRun
PARAMETER doscmd
DECLARE INTEGER WinExec IN win32api ;
STRING command, INTEGER param
retval = WinExec(doscmd,2)
Return retval
If the return value is < 32, then an error happened. If it's >= 32,
then you get the process number of the application that you started.
'2' (in the WinExec call) is the translation for SW_MINIMIZE.
HTH
/Paul