I am programming an application using the command line application output type to display debug information in the console while MOGRE is handling the actual window creation. I would like to hide the console when compiling the application for release. Not showing the console can easily be done by going into the project properties, the application tab and change the output type to windows application. When doing that only the MOGRE window will be shown.
While I believe it would be cleaner to create a windows application and attach a console to it when one wants that behavior I am still curious weather it is possible to do this programmatically.
That is, is there a way to programmatically determine that when compiling in debug mode the application compiles as command line application and when in release mode it compiles as windows application? And if so, how could it be done?
Edit: I am not asking how to attach a console to a windows forms application. I put the important part in italics out of hope that will make clearer what I want.