Okay, I used code blocks with the GCC compiler and this works for me:
#if _WIN32_WINNT < 0x0500
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0500
#endif
#include <windows.h>
int main()
{
ShowWindow(GetConsoleWindow(),SW_HIDE);
Sleep(5000);//Sleep so I can check the task manager for the process.
return 0;
}
It works inside the editor and outside of it, despite the editor making you press any key.
You can, of course, show the window again at the end of the program.
My best advice to you is to use the right compiler switch to make the console window not appear at all.