Make launcher window use dark mode
Co-Authored-By: Vlad Loktionov <13555921+VladWinner@users.noreply.github.com>
This commit is contained in:
parent
37b40a0ab1
commit
3ee314f361
@ -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{};
|
||||
|
@ -3,6 +3,10 @@
|
||||
|
||||
#include <utils/nt.hpp>
|
||||
|
||||
#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE
|
||||
#define DWMWA_USE_IMMERSIVE_DARK_MODE 20
|
||||
#endif
|
||||
|
||||
std::mutex window::mutex_;
|
||||
std::vector<window*> 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);
|
||||
}
|
||||
|
||||
|
@ -50,6 +50,7 @@
|
||||
#include <atlbase.h>
|
||||
#include <iphlpapi.h>
|
||||
#include <wincrypt.h>
|
||||
#include <dwmapi.h>
|
||||
|
||||
// min and max is required by gdi, therefore NOMINMAX won't work
|
||||
#ifdef max
|
||||
|
Loading…
Reference in New Issue
Block a user