Launching an external executable.
Posted on 1999-01-17
there are several ways to start an external executable from the main program.
I created a 32 Bit main program from which I want to launch another 32 Bit
application. I need a solution which works both under WIN95 and WIN98 and WIN NT.
For this purpose, several FAQ's recommend the usage of:
ShellExecute(Application.MainForm.Handle, 'print', , '', '',
I wanted to try it out, but I don't understand the parameter
Does it represent the external executable to be launched?
Moreover I don't know which unit I will have to include in the
uses clause of my demo program, so that my own unit can find
I simply want to do something like:
procedure TfrmMain.Button1Click(Sender: TObject);
What is the correct syntax of this ShellExecute statement with all parameters?
Unfortunately, my collection of FAQ's don't provide me with concrete examples,
so I don't understand how I can use this function.
Do you agree that ShellExecute is really the best way to launch another program?
Or should I rather use alternatives like WinExec,ExecAndWait, ShellExecute, CreateProcess.
What is the correct syntax of WinExec,ExecAndWait, ShellExecute, CreateProcess, if I want
to load my autoexec.bat into notepad.exe with the help of these functions.
BTW: I am meanwhile using Delpi 4.0 , standard edition, if that counts.
With kind regards