Recent

Author Topic: Is it possible to stop the console window appearing in a console application.  (Read 3558 times)

Josh

  • Hero Member
  • *****
  • Posts: 1271
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.
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9794
  • Debugger - SynEdit - and more
    • wiki
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.

Josh

  • Hero Member
  • *****
  • Posts: 1271
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
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

 

TinyPortal © 2005-2018