Below is the example of running command with hidden mode. Actually there lots of command type in Windows like SW_NORMAL, SW_HIDE, ...
What I am going to implement is running windows command with hidden mode.
Below is the example of windows command execution in hidden mode. program run_hidden_cmd;
uses
Vcl.Forms, ShellAPI;
{$R *.res}
procedure exec_cmd(p:string);
begin
ShellExecute( 0, 'open', PWideChar(p), nil, nil, 0); // end of 0 = SW_HIDE
end;
begin
Application.Initialize;
exec_cmd( ParamStr(1));
Application.Run;
end;
Tags: Delphi GetPort OS SW_HIDE ShellExecute exist
|