Page 1 of 1

RUN Command Alternative

Posted: Fri Mar 06, 2009 2:57 pm
by melliott42
Hello,

Since dBase III+ I have been using the RUN commend to execute programs from my applications. I need to run a DOS console application from HMG.

In HMG is there a way to run an external DOS console application and hide the DOS window or at least run it minimized where focus is not taken away from the window that called the program?

Thanks,

Michael

Re: RUN Command Alternative

Posted: Fri Mar 06, 2009 3:26 pm
by esgici
melliott42 wrote:Hello,

Since dBase III+ I have been using the RUN commend to execute programs from my applications. I need to run a DOS console application from HMG.

In HMG is there a way to run an external DOS console application and hide the DOS window or at least run it minimized where focus is not taken away from the window that called the program?

Thanks,

Michael
Hello Michael

Please take a look to C:\hmg\SAMPLES\EXECUTE\demo.prg

This sample is for a windows application, not DOS. But I hope that help you.

Also, the file specified in the EXECUTE command, may any file type "executable" by Windows; f.e. a document file.

IMHO Hiding/minimizing DOS Windows is another issue and depend to called program, no caller.

Regards

--

esgici

Re: RUN Command Alternative

Posted: Sat Mar 07, 2009 9:13 am
by dhaine_adp
Have you try to create a batch file for your required dos command and run that batch file from within your application?

example:
-------------------------------------------------------------------------------------
function Main()

RunBatchFile()



static function RunBatchFile()

PRIVATE cCommand := "@c:\hmg\batch\test.cmd" // make the extension .bat for win9x for nt bat or cmd will do.

EXECUTE FILE CMD.EXE /C "&cCommand" // this will run the batch file and terminates console window automatically
// for more info: see: at command prompt type: cmd /? or
// for win 9x type: command /?
return nil

---------------------------------------------------------------------

The example above is not tested, it is written as it is to demonstrate the principles behind.