mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2026-01-06 19:50:33 -06:00
24 lines
563 B
C++
24 lines
563 B
C++
#include <os/user_detail.h>
|
|
|
|
bool os::user::detail::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;
|
|
}
|