Skip to content

Commit

Permalink
Review
Browse files Browse the repository at this point in the history
  • Loading branch information
FileEX committed Dec 24, 2024
1 parent f251377 commit dfb2ce8
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions Client/core/DXHook/CProxyDirect3D9.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,7 @@ HRESULT CProxyDirect3D9::CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND
#endif

// Set dark titlebar if needed
HKEY hKey;
DWORD systemThemeMode = 1;
DWORD dataSize = sizeof(systemThemeMode);

if (RegOpenKeyExW(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", 0, KEY_READ, &hKey) == ERROR_SUCCESS)
{
RegQueryValueExW(hKey, L"AppsUseLightTheme", nullptr, nullptr, reinterpret_cast<LPBYTE>(&systemThemeMode), &dataSize);
RegCloseKey(hKey);
}

BOOL darkTitleBar = systemThemeMode == 0;
BOOL darkTitleBar = GetSystemRegistryValue((uint)HKEY_CURRENT_USER, "Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", "AppsUseLightTheme") == "\x0";
DwmSetWindowAttribute(hFocusWindow, DWMWA_USE_IMMERSIVE_DARK_MODE, &darkTitleBar, sizeof(darkTitleBar));

// Detect if second call to CreateDevice
Expand Down

0 comments on commit dfb2ce8

Please sign in to comment.