From 8e775a8969ad9e1abd733eaa5777032673a1d86d Mon Sep 17 00:00:00 2001 From: Jeffrey Clark Date: Mon, 21 Dec 2015 09:45:48 -0600 Subject: [PATCH] Hide console instead of closing it, fixes #164 --- src/fe_util.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/fe_util.cpp b/src/fe_util.cpp index 12517c1ec..d4779345c 100644 --- a/src/fe_util.cpp +++ b/src/fe_util.cpp @@ -723,12 +723,6 @@ bool run_program( const std::string &prog, si.dwFlags |= STARTF_USESTDHANDLES; } - if ( !have_console() ) - { - si.dwFlags |= STARTF_USESHOWWINDOW; - si.wShowWindow = SW_HIDE; - } - LPSTR cmdline = new char[ comstr.length() + 1 ]; strncpy( cmdline, comstr.c_str(), comstr.length() + 1 ); @@ -1029,7 +1023,8 @@ void preinit_helper() #ifdef SFML_SYSTEM_WINDOWS if ( !have_console() ) { - FreeConsole(); + HWND handle = GetConsoleWindow(); + ShowWindow(handle, SW_HIDE); } #endif }