Merge pull request #464 from VladWinner/main
Make launcher window use dark mode
This commit is contained in:
commit
e827eb2945
@ -1,6 +1,10 @@
|
||||
#include <std_include.hpp>
|
||||
#include "window.hpp"
|
||||
|
||||
#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE
|
||||
#define DWMWA_USE_IMMERSIVE_DARK_MODE 20
|
||||
#endif
|
||||
|
||||
namespace
|
||||
{
|
||||
thread_local uint32_t window_count = 0;
|
||||
@ -34,6 +38,10 @@ window::window(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);
|
||||
ShowWindow(this->handle_, SW_SHOW);
|
||||
SetForegroundWindow(this->handle_);
|
||||
|
@ -1,4 +1,5 @@
|
||||
#pragma once
|
||||
#pragma comment (lib, "dwmapi.lib")
|
||||
|
||||
class window
|
||||
{
|
||||
|
@ -50,6 +50,7 @@
|
||||
#include <atlsafe.h>
|
||||
#include <iphlpapi.h>
|
||||
#include <wincrypt.h>
|
||||
#include <dwmapi.h>
|
||||
#include <shellscalingapi.h>
|
||||
#include <d3d11.h>
|
||||
#include <dxgi1_6.h>
|
||||
|
Loading…
Reference in New Issue
Block a user