mirror of
https://github.com/gnif/LookingGlass.git
synced 2026-06-05 06:14:25 +00:00
[idd] all: add default refresh rate setting support
This commit is contained in:
committed by
Geoffrey McRae
parent
c2add993ac
commit
65005c0dc0
@@ -166,6 +166,26 @@ bool CSettings::GetExtraMode(DisplayMode& mode)
|
||||
return ParseModeString(extraMode, mode);
|
||||
}
|
||||
|
||||
unsigned CSettings::GetDefaultRefresh() const
|
||||
{
|
||||
DWORD refresh = 60;
|
||||
DWORD cb = sizeof(refresh);
|
||||
HKEY hKey = nullptr;
|
||||
|
||||
LONG st = RegOpenKeyExW(HKEY_LOCAL_MACHINE, LGIDD_REGKEY, 0, KEY_QUERY_VALUE, &hKey);
|
||||
if (st == ERROR_SUCCESS)
|
||||
{
|
||||
DWORD type = 0;
|
||||
st = RegGetValueW(hKey, nullptr, L"DefaultRefresh", RRF_RT_REG_DWORD, &type, &refresh, &cb);
|
||||
RegCloseKey(hKey);
|
||||
}
|
||||
|
||||
if (st != ERROR_SUCCESS || refresh < 30 || refresh > 1000)
|
||||
return 60;
|
||||
|
||||
return refresh;
|
||||
}
|
||||
|
||||
bool CSettings::ReadModesValue(std::vector<std::wstring> &out) const
|
||||
{
|
||||
HKEY hKey = nullptr;
|
||||
|
||||
Reference in New Issue
Block a user