Use HORZRES and VERTRES instead of SM_CXFULLSCREEN and SM_CYFULLSCREEN.
CORE-9283
if (dwReserved)
return 0;
- INT cxWidth = ::GetSystemMetrics(SM_CXFULLSCREEN);
- INT cyHeight = ::GetSystemMetrics(SM_CYFULLSCREEN);
+ HDC hDC = ::GetDC(NULL);
+ INT cxWidth = ::GetDeviceCaps(hDC, HORZRES);
+ INT cyHeight = ::GetDeviceCaps(hDC, VERTRES);
INT cMonitors = ::GetSystemMetrics(SM_CMONITORS);
+ ::ReleaseDC(NULL, hDC);
+
StringCchPrintfW(pszBuffer, cchBuffer, L"%dx%d(%d)", cxWidth, cyHeight, cMonitors);
return lstrlenW(pszBuffer);
}
add_executable(shlwapi_apitest ${SOURCE})
set_module_type(shlwapi_apitest win32cui)
target_link_libraries(shlwapi_apitest ${PSEH_LIB} uuid)
-add_importlibs(shlwapi_apitest shlwapi oleaut32 ole32 user32 advapi32 msvcrt kernel32)
+add_importlibs(shlwapi_apitest shlwapi oleaut32 ole32 user32 gdi32 advapi32 msvcrt kernel32)
add_dependencies(shlwapi_apitest shlwapi_resource_dll)
add_rostests_file(TARGET shlwapi_apitest)
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);