Hide console of Windows Application Hide console of Windows Application windows windows

Hide console of 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")


It sounds like your linker configuration is incorrect. Right-click the project, Properties, Linker, System, SubSystem setting. Make sure "Windows" is selected, not "Console".

And, change main() to WinMain().


You can get rid of the console by calling:

FreeConsole();