I'm trying to make a small application which starts another application depending on command line parameters.
I am using the WinMain
entry point like this:
BOOL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR commandLine, int nCmdShow) {
...
}
but I still see a console window.
How can I make sure that the no console window is ever drawn when running the application?
PS: I can hide the console window with ShowWindow(GetConsoleWindow(), SW_HIDE)
, but you still see the console window for a fraction of a second. I want to make sure that the console window is never shown.
The code is fine. The compiler flag -mwindows
will do the trick.
To set the compiler flag do the following:
-mwindows
in the line Additional Options