I have a Qt application, and when I run this application, there is a console opening behind it. In development it is nice because i see debug outputs on the console, but when I want to give this executable to the customer there should be no console window. how do I hide it?
(I am using Visual Studio 2008)
"SW_HIDE" hides the window, while "SW_SHOW" shows the window.
Exit a Console Application With the return Method in C# The return statement ends the execution of a method and returns the control to the calling or the main method. We can use the return statement inside the main() function to end our console application's execution.
Right click your project in the solution explorer and select properties. Then, under the "Application" tab change the "Output type" of your project from “Console Application” to “Windows Application.”
In the project build linker options set
/SUBSYSTEM:windows /ENTRY:mainCRTStartup
Or use the following #pragma in the source file with the int main(...)
#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With