[idd] all: add default refresh rate setting support

This commit is contained in:
Geoffrey McRae
2026-06-02 19:17:27 +10:00
committed by Geoffrey McRae
parent c2add993ac
commit 65005c0dc0
7 changed files with 36 additions and 12 deletions

View File

@@ -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;