[Lazarus] ExecuteProcess

Sven Barth pascaldragon at googlemail.com
Fri Jan 20 16:27:48 CET 2012


Am 20.01.2012 15:44, schrieb Henry Vermaak:
> On 20/01/12 14:38, Henry Vermaak wrote:
>> On 20/01/12 10:41, Kjow wrote:
>>> Hi all,
>>>
>>> I can't find it on google, so is it possible to hide the command prompt
>>> window that appears with SysUtils.ExecuteProcess('','',[]); ?
>>>
>>> I need to run some external processes, but I would not see the console
>>> window.
>>
>> Windows specific: you can do this with CreateProcess by adding
>> CREATE_NO_WINDOW to the process creation flags. Perhaps something can be
>> added to TProcess to make this easier.
>
> There's already something in TProcess that should work. Set
> TProcess.StartupOptions to suoUseShowWindow and set TProcess.ShowWindow
> to swoHIDE (not tested).

For TProcess the following should be sufficient before you run your process:

YourProcess.Options := YourProcess.Options + [poNoConsole];

Regards,
Sven




More information about the Lazarus mailing list