http://blog.csdn.net/fengzi_shen/article/details/1887893
How to hide the console window in windows console project?
#pragma comment( linker, "/subsystem:windows /entry:mainCRTStartup" )
or
modify in project properties:
linker-->system-->subsystem-->windows
linker-->advanced-->entry point-->mainCRTStartup