[Base] Moved IsUseNexusForGameBarEnabled from emulator_window to system.h

This will remove direct usage of system specific code from emulator_window
This commit is contained in:
Gliniak
2024-12-26 12:04:59 +01:00
committed by Radosław Gliński
parent bcc3c3172d
commit 9dfb0d0b68
6 changed files with 18 additions and 19 deletions

View File

@@ -64,4 +64,17 @@ bool SetProcessPriorityClass(const uint32_t priority_class) {
xeniaToWindowsPriorityClassMapping[priority_class]);
}
bool IsUseNexusForGameBarEnabled() {
const LPCWSTR reg_path = L"SOFTWARE\\Microsoft\\GameBar";
const LPCWSTR key = L"UseNexusForGameBarEnabled";
DWORD value = 0;
DWORD dataSize = sizeof(value);
RegGetValue(HKEY_CURRENT_USER, reg_path, key, RRF_RT_DWORD, nullptr, &value,
&dataSize);
return static_cast<bool>(value);
}
} // namespace xe