diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-08-22 15:21:25 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2015-08-22 15:21:25 +0200 |
commit | 3e0af6ca360e1a009ad50ddeb6a1e5058197484f (patch) | |
tree | f298aa390d5a5e33d739531c52ebce445b4dcd0d /src | |
parent | Merge pull request #2427 from cuberite/fixes (diff) | |
download | cuberite-3e0af6ca360e1a009ad50ddeb6a1e5058197484f.tar cuberite-3e0af6ca360e1a009ad50ddeb6a1e5058197484f.tar.gz cuberite-3e0af6ca360e1a009ad50ddeb6a1e5058197484f.tar.bz2 cuberite-3e0af6ca360e1a009ad50ddeb6a1e5058197484f.tar.lz cuberite-3e0af6ca360e1a009ad50ddeb6a1e5058197484f.tar.xz cuberite-3e0af6ca360e1a009ad50ddeb6a1e5058197484f.tar.zst cuberite-3e0af6ca360e1a009ad50ddeb6a1e5058197484f.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/Root.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/Root.cpp b/src/Root.cpp index 222c799b2..ba895a9d6 100644 --- a/src/Root.cpp +++ b/src/Root.cpp @@ -101,9 +101,8 @@ void cRoot::InputThread(cRoot & a_Params) void cRoot::Start(std::unique_ptr<cSettingsRepositoryInterface> a_OverridesRepo) { #ifdef _WIN32 - HWND hwnd = GetConsoleWindow(); - HMENU hmenu = GetSystemMenu(hwnd, FALSE); - EnableMenuItem(hmenu, SC_CLOSE, MF_GRAYED); // Disable close button when starting up; it causes problems with our CTRL-CLOSE handling + HMENU ConsoleMenu = GetSystemMenu(GetConsoleWindow(), FALSE); + EnableMenuItem(ConsoleMenu, SC_CLOSE, MF_GRAYED); // Disable close button when starting up; it causes problems with our CTRL-CLOSE handling #endif cLogger::cListener * consoleLogListener = MakeConsoleListener(m_RunAsService); @@ -212,7 +211,7 @@ void cRoot::Start(std::unique_ptr<cSettingsRepositoryInterface> a_OverridesRepo) m_StartTime = std::chrono::steady_clock::now(); #ifdef _WIN32 - EnableMenuItem(hmenu, SC_CLOSE, MF_ENABLED); // Re-enable close button + EnableMenuItem(ConsoleMenu, SC_CLOSE, MF_ENABLED); // Re-enable close button #endif for (;;) @@ -272,13 +271,13 @@ void cRoot::Start(std::unique_ptr<cSettingsRepositoryInterface> a_OverridesRepo) DWORD Length; INPUT_RECORD Record { - static_cast<WORD>(KEY_EVENT), + KEY_EVENT, { { TRUE, 1, VK_RETURN, - MapVirtualKey(VK_RETURN, MAPVK_VK_TO_VSC), + static_cast<WORD>(MapVirtualKey(VK_RETURN, MAPVK_VK_TO_VSC)), { { VK_RETURN } }, 0 } |