Lazarus

Programming => Operating Systems => Windows => Topic started by: Josh on February 11, 2019, 11:17:59 pm

Title: Is it possible to stop the console window appearing in a console application.
Post by: Josh on February 11, 2019, 11:17:59 pm
Hi

I have created a little app that accepts extra parameters which are then passed on to the main application.

This is working well, the only slight annoyance is that each tiome the utility is run, a quick terminal window appears and dissapears.

is it possible to stop the utility from invoking/hiding the console window

Hope that makes sense.
Title: Re: Is it possible to stop the console window appearing in a console application.
Post by: Martin_fr on February 11, 2019, 11:55:54 pm
If you run the up from an already open console (cmd.exe) then no extra window should happen)

But you can compile your app as {$apptype GUI} (or similar), or use -WG

Then windows thinks it is a gui app, but since it does not open a form, nothing will appear.
However, in this case, if you want to use writeln to stdout or read stdin, you must first check they are open.
Title: Re: Is it possible to stop the console window appearing in a console application.
Post by: Josh on February 12, 2019, 12:01:09 am
Hi Martin,

Thanks for your reply.

You beat me to answering my own question.

I turn on the -wg option in Project Options, just to see what would happen, and bingo.

Josh
TinyPortal © 2005-2018