-void setup_console_window()
-{
- auto hOut = GetStdHandle(STD_OUTPUT_HANDLE);
-
- // Disable close button in console to avoid shutdown without cleanup.
- EnableMenuItem(GetSystemMenu(GetConsoleWindow(), FALSE), SC_CLOSE , MF_GRAYED);
- DrawMenuBar(GetConsoleWindow());
- //SetConsoleCtrlHandler(HandlerRoutine, true);
-
- // Configure console size and position.
- auto coord = GetLargestConsoleWindowSize(hOut);
- coord.X /= 2;
-
- SetConsoleScreenBufferSize(hOut, coord);
-
- SMALL_RECT DisplayArea = {0, 0, 0, 0};
- DisplayArea.Right = coord.X-1;
- DisplayArea.Bottom = (coord.Y-1)/2;
- SetConsoleWindowInfo(hOut, TRUE, &DisplayArea);
-
- change_icon(::LoadIcon(GetModuleHandle(0), MAKEINTRESOURCE(101)));
-
- // Set console title.
- std::wstringstream str;
- str << "CasparCG Server " << env::version() << L" x64 ";
-#ifdef COMPILE_RELEASE
- str << " Release";
-#elif COMPILE_PROFILE
- str << " Profile";
-#elif COMPILE_DEVELOP
- str << " Develop";
-#elif COMPILE_DEBUG
- str << " Debug";
-#endif
- SetConsoleTitle(str.str().c_str());
-}
-