Главная страница | назад





Article #15645: Executing a program from my application

 Question and Answer Database

FAQ645D.txt   Executing a program from my application
Category   :Windows API
Platform    :All
Product    :All 32 bit  

Question:
How do I execute a program from my application?


Answer:
Using the WinExec function is the easiest way to execute an
program from your application.

To execute a standard program, simply use:

WinExec('C:\WINDOWS\NOTEPAD.EXE', SW_SHOWNORMAL);

To add a command line, use:

WinExec('C:\WINDOWS\NOTEPAD.EXE C:\WINDOWS\WIN.INI', SW_SHOWNORMAL);

To pop up a DOS box, use:

WinExec('COMMAND.COM', SW_SHOWNORMAL);

To execute a DOS command, use:

WinExec('COMMAND.COM /C DIR *.*', SW_SHOWNORMAL);

7/16/98 4:31:28 PM
 

Last Modified: 01-SEP-99