Can you do this? Basically just have the console hide itself, but still run.
Get a handle to the console window and call ShowWindow on it with the appropriate parameters?
Build your application with a windows subsystem and use AllocConsole and FreeConsole instead.