mirror of
https://github.com/goatcorp/Dalamud.git
synced 2025-12-12 10:17:22 +01:00
Enable dark mode window title bar if applicable
This commit is contained in:
parent
5a7f509941
commit
cfd3567a8a
2 changed files with 12 additions and 0 deletions
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
// Windows Header Files (2)
|
// Windows Header Files (2)
|
||||||
#include <Dbt.h>
|
#include <Dbt.h>
|
||||||
|
#include <dwmapi.h>
|
||||||
#include <PathCch.h>
|
#include <PathCch.h>
|
||||||
#include <Psapi.h>
|
#include <Psapi.h>
|
||||||
#include <ShlObj.h>
|
#include <ShlObj.h>
|
||||||
|
|
|
||||||
|
|
@ -201,6 +201,17 @@ void xivfixes::prevent_devicechange_crashes(bool bApply) {
|
||||||
if (uMsg == WM_SIZE && wParam == SIZE_RESTORED && (GetWindowLongW(hWnd, GWL_STYLE) & WS_POPUP))
|
if (uMsg == WM_SIZE && wParam == SIZE_RESTORED && (GetWindowLongW(hWnd, GWL_STYLE) & WS_POPUP))
|
||||||
return ShowWindow(hWnd, SW_MAXIMIZE);
|
return ShowWindow(hWnd, SW_MAXIMIZE);
|
||||||
|
|
||||||
|
if (uMsg == WM_CREATE) {
|
||||||
|
// While at it, also apply dark mode title bar to the game.
|
||||||
|
if (const auto dwmapi = LoadLibraryW(L"dwmapi.dll")) {
|
||||||
|
if (const auto fn = reinterpret_cast<decltype(&DwmSetWindowAttribute)>(GetProcAddress(dwmapi, "DwmSetWindowAttribute"))) {
|
||||||
|
const BOOL trueValue = TRUE;
|
||||||
|
fn(hWnd, DWMWA_USE_IMMERSIVE_DARK_MODE, &trueValue, sizeof trueValue);
|
||||||
|
}
|
||||||
|
FreeLibrary(dwmapi);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return s_pfnGameWndProc(hWnd, uMsg, wParam, lParam);
|
return s_pfnGameWndProc(hWnd, uMsg, wParam, lParam);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue