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
RUN Command Alternative
Moderator: Rathinagiri
- esgici
- Posts: 4543
- Joined: Wed Jul 30, 2008 9:17 pm
- DBs Used: DBF
- Location: iskenderun / Turkiye
- Contact:
Re: RUN Command Alternative
Hello Michaelmelliott42 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
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
Viva INTERNATIONAL HMG
- dhaine_adp
- Posts: 457
- Joined: Wed Aug 06, 2008 12:22 pm
- Location: Manila, Philippines
Re: RUN Command Alternative
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.
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.
Regards,
Danny
Manila, Philippines
Danny
Manila, Philippines