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 <std_include.hpp>
|
||||||
#include "window.hpp"
|
#include "window.hpp"
|
||||||
|
|
||||||
|
#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE
|
||||||
|
#define DWMWA_USE_IMMERSIVE_DARK_MODE 20
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
thread_local uint32_t window_count = 0;
|
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,
|
this->handle_ = CreateWindowExA(NULL, this->wc_.lpszClassName, title.data(), flags, x, y, width, height, nullptr,
|
||||||
nullptr, this->wc_.hInstance, this);
|
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);
|
SendMessageA(this->handle_, WM_DPICHANGED, 0, 0);
|
||||||
ShowWindow(this->handle_, SW_SHOW);
|
ShowWindow(this->handle_, SW_SHOW);
|
||||||
SetForegroundWindow(this->handle_);
|
SetForegroundWindow(this->handle_);
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
#pragma comment (lib, "dwmapi.lib")
|
||||||
|
|
||||||
class window
|
class window
|
||||||
{
|
{
|
||||||
|
@ -50,6 +50,7 @@
|
|||||||
#include <atlsafe.h>
|
#include <atlsafe.h>
|
||||||
#include <iphlpapi.h>
|
#include <iphlpapi.h>
|
||||||
#include <wincrypt.h>
|
#include <wincrypt.h>
|
||||||
|
#include <dwmapi.h>
|
||||||
#include <shellscalingapi.h>
|
#include <shellscalingapi.h>
|
||||||
#include <d3d11.h>
|
#include <d3d11.h>
|
||||||
#include <dxgi1_6.h>
|
#include <dxgi1_6.h>
|
||||||
|
Loading…
Reference in New Issue
Block a user