diff --git a/library/Console-posix.cpp b/library/Console-posix.cpp index fcc56b205..74d998ea9 100644 --- a/library/Console-posix.cpp +++ b/library/Console-posix.cpp @@ -863,3 +863,13 @@ void Console::msleep (unsigned int msec) if (msec > 1000) sleep(msec/1000000); usleep((msec % 1000000) * 1000); } + +void Console::hide() +{ + //Warmist: don't know if it's possible... +} + +void Console::show() +{ + //Warmist: don't know if it's possible... +} \ No newline at end of file diff --git a/library/Console-windows.cpp b/library/Console-windows.cpp index f0cdda387..304e215e0 100644 --- a/library/Console-windows.cpp +++ b/library/Console-windows.cpp @@ -589,3 +589,13 @@ void Console::msleep (unsigned int msec) { Sleep(msec); } + +void Console::hide() +{ + ShowWindow( GetConsoleWindow(), SW_HIDE ); +} + +void Console::show() +{ + ShowWindow( GetConsoleWindow(), SW_RESTORE ); +} \ No newline at end of file diff --git a/library/Core.cpp b/library/Core.cpp index 6ffeea7b4..bae243358 100644 --- a/library/Core.cpp +++ b/library/Core.cpp @@ -788,6 +788,14 @@ command_result Core::runCommand(color_ostream &con, const std::string &first, ve return CR_WRONG_USAGE; } } + else if(first=="hide") + { + getConsole().hide(); + } + else if(first=="show") + { + getConsole().show(); + } else { command_result res = plug_mgr->InvokeCommand(con, first, parts); diff --git a/library/include/Console.h b/library/include/Console.h index ce3c90884..ac76ef1cf 100644 --- a/library/include/Console.h +++ b/library/include/Console.h @@ -157,6 +157,9 @@ namespace DFHack bool isInited (void) { return inited; }; bool is_console() { return true; } + + void hide(); + void show(); private: Private * d; tthread::recursive_mutex * wlock;