mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-01-01 17:20:01 -06:00
24 lines
548 B
C++
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;
|
|
}
|