RUN Command Alternative

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
melliott42
Posts: 119
Joined: Wed Feb 18, 2009 2:14 pm

RUN Command Alternative

Post 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
User avatar
esgici
Posts: 4543
Joined: Wed Jul 30, 2008 9:17 pm
DBs Used: DBF
Location: iskenderun / Turkiye
Contact:

Re: RUN Command Alternative

Post 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
Viva INTERNATIONAL HMG :D
User avatar
dhaine_adp
Posts: 457
Joined: Wed Aug 06, 2008 12:22 pm
Location: Manila, Philippines

Re: RUN Command Alternative

Post 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.
Regards,

Danny
Manila, Philippines
Post Reply