How to prevent the console window popping up.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a console application that brings up a dialog if invoked with no
command line parameters. If I double click on my application a console window
is briefly displayed before the dialog appears (I have this code in my app:

if (args.length ==0) FreeConsole() which causes the console to be closed)

Is there a way to prevent this console window from appearing in the first
place.
 
It's a console app, so of course it going to open a console if you double
click it from windows explorer. Open a DOS Prompt window
(Start->Run->cmd.exe), then run your console app, and no console window
opens.
 
have you tried compiling it as a winexe in the target /t parm of the
compiler options, if it has no interface it wont spawn a console.

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director
 
Back
Top