Console never opening

Ok, what code causes a console to spawn to begin with? I am writing a console app, but it requires no user input, so there really is no purpose of having the console come up at all. How can I prevent this? I would prefer it just alert the user via MessageBoxA() function instead of console. (Windows platform)
Use the WinMain function instead, and select the Win32 Application option instead. (I'm guessing you're using VC++.) I don't think that automatically spawns a window.

By the way, this goes into the Windows Programming section.
Last edited on
Depending on the IDE/Compiler you are using you can change some settings and the console window won't open
When you execute a Windows program the operating system is what creates the console for you. It depends on what subsystem is set in the PE file format.

As NGen said, use the WinMain function instead. Go to project options and change subsystem from Console to GUI. Note that GUI won't display anything until you provide the code which draws the window and controls.
Topic archived. No new replies allowed.