April 12th, 2004, 09:13 PM
Running external exe's
Thi is probly an easy noob question for many of you to answer, but can someone tell how you run an external exe from within a delphi program?
April 13th, 2004, 12:42 AM
Something like this:
(straight from my head - look up the parameter order and meanings in the WinAPI help.)
ShellExecute("program.exe", "param1 param2 param3", SW_SHOWNORMAL, 0);
April 13th, 2004, 07:40 AM
Hey cheers for the help,
This is the line of code I used in the end, it's a bit bodged as I don't know what the HWnd property is.
Is there any glaring mistakes or possible improvements.
(The code is basically ment to reload itself)
ShellExecute(AllocateHWnd(WndProc), '', PAnsiChar(Application.ExeName), '', '', 0);
April 13th, 2004, 12:02 PM
hWnd is the handle to the parent window. You can use "Application.Handle" here.