Files
UnleashedRecomp-hedge-dev/UnleashedRecomp/os/win32/user_win32.cpp
2025-01-19 21:09:47 +03:00

24 lines
548 B
C++

#include <os/user.h>
bool os::user::IsDarkTheme()
{
HKEY hKey;
if (RegOpenKeyExA(HKEY_CURRENT_USER, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", 0, KEY_READ, &hKey) == ERROR_SUCCESS)
{
DWORD value = 0;
DWORD valueSize = sizeof(value);
if (RegQueryValueExA(hKey, "AppsUseLightTheme", nullptr, nullptr, (LPBYTE)&value, &valueSize) == ERROR_SUCCESS)
{
RegCloseKey(hKey);
return value == 0;
}
RegCloseKey(hKey);
}
return false;
}