mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 10:04:49 +00:00
[SHLWAPI][SHLWAPI_APITEST] Fix SHGetPerScreenResName (#5701)
Use HORZRES and VERTRES instead of SM_CXFULLSCREEN and SM_CYFULLSCREEN. CORE-9283
This commit is contained in:
parent
08cc45eef9
commit
ff5ccb5948
3 changed files with 13 additions and 6 deletions
|
@ -1947,9 +1947,12 @@ SHGetPerScreenResName(
|
|||
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);
|
||||
}
|
||||
|
|
|
@ -25,6 +25,6 @@ add_rc_deps(testdata.rc ${CMAKE_CURRENT_BINARY_DIR}/shlwapi_resource_dll/shlwapi
|
|||
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)
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue