Use correct parameters to query highcontrastmode on Windows

Task-number: QTBUG-113645
Change-Id: Ib400253a5589345648025c22c1487598cbefbd23
Pick-to: 6.6 6.5
Reviewed-by: Yuhang Zhao <yuhangzhao@deepin.org>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
bb10
Wladimir Leuschner 2023-05-22 12:05:11 +03:00
parent d656f7405e
commit e5c136c179
1 changed files with 5 additions and 1 deletions

View File

@ -1107,7 +1107,11 @@ bool QWindowsTheme::queryDarkMode()
bool QWindowsTheme::queryHighContrast()
{
return booleanSystemParametersInfo(SPI_GETHIGHCONTRAST, false);
HIGHCONTRAST hcf = {};
hcf.cbSize = static_cast<UINT>(sizeof(HIGHCONTRAST));
if (SystemParametersInfo(SPI_GETHIGHCONTRAST, hcf.cbSize, &hcf, FALSE))
return hcf.dwFlags & HCF_HIGHCONTRASTON;
return false;
}
QPlatformMenuItem *QWindowsTheme::createPlatformMenuItem() const