在VS的开头加入下面的代码 #pragma comment(linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"") 就可以隐藏控制台窗口了