your (linker) subsystem is console. If you want a gui using windows messages event loop, you need to change the subsystem, or create a new studio project (win32 project) with better defaults. This will give you a WinMain or _tWinMain (or similar), instead of your current main().