The only way I know to do what you're asking is platform dependent, so this will only work on Windows.
You can hide the console window with the Windows API function ShowWindow: http://msdn.microsoft.com/en-us/library/windows/desktop/ms633548(v=vs.85).aspx
You can create a function to hide your console window something like the following:
While building the above solution I get the following error:
"Error 1 error C1010: unexpected end of file while looking for precompiled header. Did you forget to add '#include "stdafx.h"' to your source? c:\users\urban\documents\visual studio 2013\projects\win32project3\win32project3\win32project3.cpp 8 1 Win32Project3"