parent
7cc51b8c2e
commit
5087c473f6
|
@ -671,21 +671,8 @@ UINT GetDotsPerInchForSystem()
|
||||||
return WNEF_EXECUTE_WINAPI_RETURN(GetSystemDpiForProcess,
|
return WNEF_EXECUTE_WINAPI_RETURN(GetSystemDpiForProcess,
|
||||||
0,
|
0,
|
||||||
WNEF_EXECUTE_WINAPI_RETURN(GetCurrentProcess, nullptr));
|
WNEF_EXECUTE_WINAPI_RETURN(GetCurrentProcess, nullptr));
|
||||||
} else if (m_lpGetDpiForMonitor) {
|
}
|
||||||
UINT dpiX = m_defaultDotsPerInch, dpiY = m_defaultDotsPerInch;
|
if (m_lpGetDpiForSystem) {
|
||||||
/*
|
|
||||||
WNEF_EXECUTE_WINAPI(GetDpiForMonitor,
|
|
||||||
WNEF_EXECUTE_WINAPI_RETURN(MonitorFromWindow,
|
|
||||||
nullptr,
|
|
||||||
handle,
|
|
||||||
MONITOR_DEFAULTTONEAREST),
|
|
||||||
MDT_EFFECTIVE_DPI,
|
|
||||||
&dpiX,
|
|
||||||
&dpiY)
|
|
||||||
*/
|
|
||||||
// The values of *dpiX and *dpiY are identical.
|
|
||||||
return dpiX == dpiY ? dpiY : dpiX;
|
|
||||||
} else if (m_lpGetDpiForSystem) {
|
|
||||||
return WNEF_EXECUTE_WINAPI_RETURN(GetDpiForSystem, 0);
|
return WNEF_EXECUTE_WINAPI_RETURN(GetDpiForSystem, 0);
|
||||||
}
|
}
|
||||||
return getScreenDpi(m_defaultDotsPerInch);
|
return getScreenDpi(m_defaultDotsPerInch);
|
||||||
|
@ -698,9 +685,24 @@ UINT GetDotsPerInchForWindow(const HWND handle)
|
||||||
// Return hard-coded DPI if DPI scaling is disabled.
|
// Return hard-coded DPI if DPI scaling is disabled.
|
||||||
return m_defaultDotsPerInch;
|
return m_defaultDotsPerInch;
|
||||||
}
|
}
|
||||||
if (m_lpGetDpiForWindow && WNEF_EXECUTE_WINAPI_RETURN(IsWindow, FALSE, handle)) {
|
if (WNEF_EXECUTE_WINAPI_RETURN(IsWindow, FALSE, handle)) {
|
||||||
|
if (m_lpGetDpiForWindow) {
|
||||||
return WNEF_EXECUTE_WINAPI_RETURN(GetDpiForWindow, 0, handle);
|
return WNEF_EXECUTE_WINAPI_RETURN(GetDpiForWindow, 0, handle);
|
||||||
}
|
}
|
||||||
|
if (m_lpGetDpiForMonitor) {
|
||||||
|
UINT dpiX = m_defaultDotsPerInch, dpiY = m_defaultDotsPerInch;
|
||||||
|
WNEF_EXECUTE_WINAPI(GetDpiForMonitor,
|
||||||
|
WNEF_EXECUTE_WINAPI_RETURN(MonitorFromWindow,
|
||||||
|
nullptr,
|
||||||
|
handle,
|
||||||
|
MONITOR_DEFAULTTONEAREST),
|
||||||
|
MDT_EFFECTIVE_DPI,
|
||||||
|
&dpiX,
|
||||||
|
&dpiY)
|
||||||
|
// The values of *dpiX and *dpiY are identical.
|
||||||
|
return dpiX == dpiY ? dpiY : dpiX;
|
||||||
|
}
|
||||||
|
}
|
||||||
return GetDotsPerInchForSystem();
|
return GetDotsPerInchForSystem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue