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().