diff --git a/Windows/MainWindow.cpp b/Windows/MainWindow.cpp index d5933d1000..1c5e12b5f0 100644 --- a/Windows/MainWindow.cpp +++ b/Windows/MainWindow.cpp @@ -360,6 +360,10 @@ namespace MainWindow } } + void Minimize() { + ShowWindow(hwndMain, SW_MINIMIZE); + } + RECT DetermineWindowRectangle() { RECT rc; diff --git a/Windows/MainWindow.h b/Windows/MainWindow.h index d2459edfeb..c03b2b2687 100644 --- a/Windows/MainWindow.h +++ b/Windows/MainWindow.h @@ -62,6 +62,7 @@ namespace MainWindow HINSTANCE GetHInstance(); HWND GetDisplayHWND(); void ToggleFullscreen(HWND hWnd, bool goingFullscreen); + void Minimize(); void SendToggleFullscreen(bool fullscreen); // To be used off-thread void ToggleDebugConsoleVisibility(); void SetInternalResolution(int res = -1); diff --git a/Windows/main.cpp b/Windows/main.cpp index c4c79c809c..0d872e3b99 100644 --- a/Windows/main.cpp +++ b/Windows/main.cpp @@ -482,6 +482,11 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin g_Config.bEnableLogging = true; #endif + if (iCmdShow == SW_MAXIMIZE) { + // Consider this to mean --fullscreen. + g_Config.bFullScreen = true; + } + LogManager::Init(); // Consider at least the following cases before changing this code: // - By default in Release, the console should be hidden by default even if logging is enabled. @@ -521,6 +526,11 @@ int WINAPI WinMain(HINSTANCE _hInstance, HINSTANCE hPrevInstance, LPSTR szCmdLin MainWindow::CreateDebugWindows(); + const bool minimized = iCmdShow == SW_MINIMIZE || iCmdShow == SW_SHOWMINIMIZED || iCmdShow == SW_SHOWMINNOACTIVE; + if (minimized) { + MainWindow::Minimize(); + } + // Emu thread is always running! EmuThread_Start(); InputDevice::BeginPolling();