diff --git a/Dalamud.Boot/pch.h b/Dalamud.Boot/pch.h index 2e11e0ab7..3302a44fb 100644 --- a/Dalamud.Boot/pch.h +++ b/Dalamud.Boot/pch.h @@ -16,6 +16,7 @@ // Windows Header Files (2) #include +#include #include #include #include diff --git a/Dalamud.Boot/xivfixes.cpp b/Dalamud.Boot/xivfixes.cpp index 21786a4c1..c37511d83 100644 --- a/Dalamud.Boot/xivfixes.cpp +++ b/Dalamud.Boot/xivfixes.cpp @@ -204,6 +204,17 @@ void xivfixes::prevent_devicechange_crashes(bool bApply) { ) 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(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); });