Hello dear Lazarus community,
as I am trying to launch external programs using the TProcess object, I stumbled upon a few problems.
I am in need to launch several programs. I've got one controlling program which starts without any visible window (called Controller). This controller should launch several other executables which do have a form to show. They have to be launched all around the same time and I need to kill/start new whenever I want to. I want to do it this way instead of using threads because the OS itself will do the scheduling of the processes so that's not my concern.
Now, I create an array with specific objects. These objects all have their own TProcess object. I create it like this:
var
shellTerminal: TProcess;
begin
try
shellTerminal:= TProcess.Create(nil);
shellTerminal.Executable:= '/bin/sh';
shellTerminal.Parameters.Add('-c');
shellTerminal.Parameters.Add(_appLocation + _appName + ' ' + ParamString);
ShowMessage(_appLocation + _appName + ' ' + ParamString);
shellTerminal.Execute;
shellTerminal.Parameters.Clear;
except
end;
However, in this way, it only launches 1 application. The others aren't started. It works when I use shellTerminal.Options := shellTerminal.Options + [poNewConsole];
but then there is this ugly console AND the form visible (I only want the form to be visible).
Is there any way to start multiple processes without showing the consoles?
PS: the opstion poNoConsole doesn't work together with the poNewConsole
Thanks in advance,
BlueMoony