On 20/01/12 15:27, Sven Barth wrote:
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];

Ah, well that's much easier. And it seems to use DETACHED_PROCESS. I didn't know that DETACHED_PROCESS hides the console window, too.

Henry

--
_______________________________________________
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply via email to