EXE is both Windows and Console

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.
 
A

AlexS

Hi, Lee

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

HTH
Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top