diff --git a/src/client/component/console.cpp b/src/client/component/console.cpp index 422927f5..e865883b 100644 --- a/src/client/component/console.cpp +++ b/src/client/component/console.cpp @@ -288,6 +288,13 @@ namespace console update(); break; } + case VK_ESCAPE: + { + con.cursor = 0; + clear_output(); + strncpy_s(con.buffer, "", sizeof(con.buffer)); + break; + } default: { const auto c = record.Event.KeyEvent.uChar.AsciiChar; @@ -356,7 +363,7 @@ namespace console con.thread = utils::thread::create_named_thread("Console", []() { const auto handle = GetStdHandle(STD_INPUT_HANDLE); - HANDLE handles[2] = { handle, con.kill_event }; + HANDLE handles[2] = {handle, con.kill_event}; MSG msg{}; INPUT_RECORD record{}; diff --git a/src/client/launcher/window.cpp b/src/client/launcher/window.cpp index b9390612..59b004b4 100644 --- a/src/client/launcher/window.cpp +++ b/src/client/launcher/window.cpp @@ -3,6 +3,10 @@ #include +#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE +#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 +#endif + std::mutex window::mutex_; std::vector window::windows_; @@ -37,6 +41,10 @@ void window::create(const std::string& title, const int width, const int height, this->handle_ = CreateWindowExA(NULL, this->wc_.lpszClassName, title.data(), flags, x, y, width, height, nullptr, nullptr, this->wc_.hInstance, this); + BOOL value = TRUE; + DwmSetWindowAttribute(this->handle_, + DWMWA_USE_IMMERSIVE_DARK_MODE, &value, sizeof(value)); + SendMessageA(this->handle_, WM_DPICHANGED, 0, 0); } diff --git a/src/client/std_include.hpp b/src/client/std_include.hpp index f6fbf804..5f68ac6d 100644 --- a/src/client/std_include.hpp +++ b/src/client/std_include.hpp @@ -50,6 +50,7 @@ #include #include #include +#include // min and max is required by gdi, therefore NOMINMAX won't work #ifdef max