[Lazarus] GUI Front-end to Windows console application???

Sven Barth pascaldragon at googlemail.com
Tue Jan 18 09:45:44 CET 2011


Am 17.01.2011 23:52, schrieb Bo Berglund:
> On Thu, 13 Jan 2011 23:02:03 +0100, Bo Berglund
> <bo.berglund at gmail.com>  wrote:
>
>> On Thu, 13 Jan 2011 22:02:32 +0100, Sven Barth
>> <pascaldragon at googlemail.com>  wrote:
>>
>>> On 13.01.2011 21:47, Bo Berglund wrote:
>>>>
>>>> Any pointers to how this can be done appreciated.
>>>>
>>>>
>>>
>>> You could use TProcess for this (found in unit "process").
>>>
>>> It's documentation is here:
>>> http://www.freepascal.org/docs-html/fcl/process/tprocess.html
>>>
>>> And on the Wiki are examples for using it:
>>> http://wiki.lazarus.freepascal.org/Executing_External_Programs
>>>
>>> I hope this helps you further (if not feel free to ask, of coures :) ).
>>>
>>> Regards,
>>> Sven
>>
>> Thanks Sven!
>> This is exactly what I was looking for! :-)
>> Good examples too.
>>
>
> I have used this for my test program and there was an annoying thing
> that I had to fix:
> Whenever I call the Execute method a black console window pops up and
> since I use pipes there is nothing shown in this window.
>
> To stop this from happening I set the ShowWindow property to swoHIDE.
>

Include "poNoConsole" to the Options property of your TProcess instance. 
This should stop the window from appearing.

> So far so good, but when I read the help on TProcess it says that this
> property applies only to Windows. So what happens on Linux?
> Will the console show up on screen then?
> Or is it automatically hidden in Linux?
>
> Can't test myself because I am on Windows XP.
>
>

Using the property Options from above this should work in a cross 
platform way.

Regards,
Sven




More information about the Lazarus mailing list