diff --git a/idd/LGIddHelper/CRegistrySettings.cpp b/idd/LGIddHelper/CRegistrySettings.cpp index bab9400c..76396d7e 100644 --- a/idd/LGIddHelper/CRegistrySettings.cpp +++ b/idd/LGIddHelper/CRegistrySettings.cpp @@ -209,3 +209,26 @@ LSTATUS CRegistrySettings::setNoGPU(bool noGPU) DWORD dwValue = noGPU; return RegSetValueEx(hKey, L"NoGPU", 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(DWORD)); } + +std::optional CRegistrySettings::getExclusiveMonitor() +{ + DWORD result, cbData = sizeof result; + + LSTATUS status = RegGetValue(hKey, nullptr, L"ExclusiveMonitor", RRF_RT_REG_DWORD, nullptr, &result, &cbData); + switch (status) + { + case ERROR_SUCCESS: + return !!result; + case ERROR_FILE_NOT_FOUND: + return true; + default: + DEBUG_ERROR_HR(status, "RegGetValue(ExclusiveMonitor)"); + return {}; + } +} + +LSTATUS CRegistrySettings::setExclusiveMonitor(bool exclusive) +{ + DWORD dwValue = exclusive; + return RegSetValueEx(hKey, L"ExclusiveMonitor", 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(DWORD)); +} diff --git a/idd/LGIddHelper/CRegistrySettings.h b/idd/LGIddHelper/CRegistrySettings.h index 8a330054..15414986 100644 --- a/idd/LGIddHelper/CRegistrySettings.h +++ b/idd/LGIddHelper/CRegistrySettings.h @@ -53,4 +53,7 @@ public: std::optional getNoGPU(); LSTATUS setNoGPU(bool noGPU); + + std::optional getExclusiveMonitor(); + LSTATUS setExclusiveMonitor(bool exclusive); };