EXE is both Windows and Console

  • Thread starter Thread starter Lee Gillie
  • Start date Start date
L

Lee Gillie

I'd like to make an EXE that behaves as a Windows Application if
invoked with no command line parameters, and as a Console Application
if there are arguments.

If I say the project is a Console App, then a new console window is
created, regardless, when starting. It is easy enough to get a window
app up and running from a console app. The console window is easy
enough to get rid of, but it appears before I can supress it, and so I
don't like the now-im-here, now-im-not black window.

If I say the project is a windows app, then I can get a console
created and assigned, but when run from a DOS prompt I have not been
able to find the magic to get the console class talking to this
window.
 
Hi, Lee

you need to use Win32 API GetConsoleWindow to attach it properly to .Net
exe. Sufficient to compile then to WinExe.

HTH
Alex
 
Back
Top