Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide console of Windows Application

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)

like image 714
ufukgun Avatar asked Jan 26 '10 13:01

ufukgun


People also ask

How do I hide the console in Windows?

"SW_HIDE" hides the window, while "SW_SHOW" shows the window.

How do I close the console application?

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.

How do I change the console application in Windows?

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


1 Answers

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") 
like image 152
datenwolf Avatar answered Oct 01 '22 07:10

datenwolf