I'm building a application that uses a TProcess
called AProcess
like this:
procedure TFormMain.btCompileClick(Sender: TObject);
begin
AProcess := TProcess.Create(nil);
try
AProcess.CommandLine := 'gcc.exe "' + OpenDialog1.FileName + '"'
+ ' -o "' + OpenDialog2.FileName + '"';
AProcess.Options := AProcess.Options + [poWaitOnExit, poUsePipes];
AProcess.Execute;
OutputMemo.Lines.BeginUpdate;
OutputMemo.Lines.Clear;
OutputMemo.Lines.LoadFromStream(AProcess.Output);
OutputMemo.Lines.EndUpdate;
finally
AProcess.Free;
end;
end;
But when I click on the button, I got a console window for some seconds and then it exits and all the output of the process is shown on OutputMemo
, but I've putted the TMemo
because I don't want the console screen. Then I want to know how I can hide this console screen.