mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-07-20 22:32:01 +00:00
[idd] helper: add setting for exclusive monitor (default: yes)
This commit is contained in:
@@ -209,3 +209,26 @@ LSTATUS CRegistrySettings::setNoGPU(bool noGPU)
|
|||||||
DWORD dwValue = noGPU;
|
DWORD dwValue = noGPU;
|
||||||
return RegSetValueEx(hKey, L"NoGPU", 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(DWORD));
|
return RegSetValueEx(hKey, L"NoGPU", 0, REG_DWORD, (LPBYTE)&dwValue, sizeof(DWORD));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::optional<bool> 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));
|
||||||
|
}
|
||||||
|
|||||||
@@ -53,4 +53,7 @@ public:
|
|||||||
|
|
||||||
std::optional<bool> getNoGPU();
|
std::optional<bool> getNoGPU();
|
||||||
LSTATUS setNoGPU(bool noGPU);
|
LSTATUS setNoGPU(bool noGPU);
|
||||||
|
|
||||||
|
std::optional<bool> getExclusiveMonitor();
|
||||||
|
LSTATUS setExclusiveMonitor(bool exclusive);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user