[SHLWAPI][SHLWAPI_APITEST] Fix SHGetPerScreenResName (#5701)

Use HORZRES and VERTRES instead of SM_CXFULLSCREEN and SM_CYFULLSCREEN.
CORE-9283
This commit is contained in:
Katayama Hirofumi MZ
2023-09-19 11:02:59 +09:00
committed by GitHub
parent 08cc45eef9
commit ff5ccb5948
3 changed files with 13 additions and 6 deletions

View File

@@ -826,10 +826,14 @@ static void SHPropertyBag_OnIniFile(void)
static void SHPropertyBag_PerScreenRes(void)
{
HDC hDC = GetDC(NULL);
INT cxWidth = GetDeviceCaps(hDC, HORZRES);
INT cyHeight = GetDeviceCaps(hDC, VERTRES);
INT cMonitors = GetSystemMetrics(SM_CMONITORS);
ReleaseDC(NULL, hDC);
WCHAR szBuff1[64], szBuff2[64];
StringCchPrintfW(szBuff1, _countof(szBuff1), L"%dx%d(%d)",
GetSystemMetrics(SM_CXFULLSCREEN), GetSystemMetrics(SM_CYFULLSCREEN),
GetSystemMetrics(SM_CMONITORS));
StringCchPrintfW(szBuff1, _countof(szBuff1), L"%dx%d(%d)", cxWidth, cyHeight, cMonitors);
szBuff2[0] = UNICODE_NULL;
SHGetPerScreenResName(szBuff2, _countof(szBuff2), 0);