Running Another Program With Delphi
Running Another Program With Delphi
Running Another Program With Delphi
*) nShowCmd SW_HIDE, if we want to run the program but the program does not appear on the
screen
SW_MAXIMIZE, if we want to run the program but in a state maximize.
SW_MINIMIZE, if we want to run the program but in a state minimize.
SW_SHOW, if we want to run the program with a normal state.
*note : REMEMBER! LPCTSTR is a pointer type STRING, so to fill them we must add PCHAR (), if we
leave it out then just fill nil
Example :
structure function:
function WinExecAndWait32(
FileName: string;
Visibility: Integer): Longword;
*description:
Filename folder and filename that will be called
Visibility same as the number 1 nShowCmd
Longword results from the calling program
{$APPTYPE CONSOLE}
uses
SysUtils, ShellAPI, Windows;
begin
WinExecAndWait32('c:\windows\notepad.exe',SW_SHOWNORMAL);
end.
GOOD LUCK !!
Ridwan Syarif S