mirror of
https://github.com/crystalidea/qt6windows7.git
synced 2024-11-22 11:40:00 +08:00
6.6.0 - windows 7 compatibility works
This commit is contained in:
parent
5cf9645728
commit
a8ff2e3e8b
@ -459,7 +459,7 @@ QtWindows::DpiAwareness QWindowsContext::windowDpiAwareness(HWND hwnd)
|
||||
|
||||
if (QWindowsContext::user32dll.getWindowDpiAwarenessContext)
|
||||
{
|
||||
const auto context = GetWindowDpiAwarenessContext(hwnd);
|
||||
const auto context = QWindowsContext::user32dll.getWindowDpiAwarenessContext(hwnd);
|
||||
return dpiAwarenessContextToQtDpiAwareness(context);
|
||||
}
|
||||
|
||||
@ -477,7 +477,7 @@ QtWindows::DpiAwareness QWindowsContext::processDpiAwareness()
|
||||
// return the default DPI_AWARENESS_CONTEXT for the process if
|
||||
// SetThreadDpiAwarenessContext() was never called. So we can use
|
||||
// it as an equivalent.
|
||||
const auto context = GetThreadDpiAwarenessContext();
|
||||
const auto context = QWindowsContext::user32dll.getThreadDpiAwarenessContext();
|
||||
return dpiAwarenessContextToQtDpiAwareness(context);
|
||||
}
|
||||
|
||||
@ -990,8 +990,8 @@ void QWindowsContext::forceNcCalcSize(HWND hwnd)
|
||||
bool QWindowsContext::systemParametersInfo(unsigned action, unsigned param, void *out,
|
||||
unsigned dpi)
|
||||
{
|
||||
const BOOL result = dpi != 0
|
||||
? SystemParametersInfoForDpi(action, param, out, 0, dpi)
|
||||
const BOOL result = (QWindowsContext::user32dll.systemParametersInfoForDpi != nullptr && dpi != 0)
|
||||
? QWindowsContext::user32dll.systemParametersInfoForDpi(action, param, out, 0, dpi)
|
||||
: SystemParametersInfo(action, param, out, 0);
|
||||
return result == TRUE;
|
||||
}
|
||||
|
@ -68,13 +68,13 @@ struct QWindowsUser32DLL
|
||||
typedef BOOL (WINAPI *SetDisplayAutoRotationPreferences)(DWORD);
|
||||
typedef BOOL (WINAPI *AdjustWindowRectExForDpi)(LPRECT,DWORD,BOOL,DWORD,UINT);
|
||||
typedef BOOL (WINAPI *EnableNonClientDpiScaling)(HWND);
|
||||
typedef int (WINAPI *GetWindowDpiAwarenessContext)(HWND);
|
||||
typedef int (WINAPI *GetAwarenessFromDpiAwarenessContext)(int);
|
||||
typedef DPI_AWARENESS_CONTEXT (WINAPI *GetWindowDpiAwarenessContext)(HWND);
|
||||
typedef DPI_AWARENESS (WINAPI *GetAwarenessFromDpiAwarenessContext)(int);
|
||||
typedef BOOL (WINAPI *SystemParametersInfoForDpi)(UINT, UINT, PVOID, UINT, UINT);
|
||||
typedef int (WINAPI *GetDpiForWindow)(HWND);
|
||||
typedef BOOL (WINAPI *GetSystemMetricsForDpi)(INT, UINT);
|
||||
typedef BOOL (WINAPI *AreDpiAwarenessContextsEqual)(DPI_AWARENESS_CONTEXT, DPI_AWARENESS_CONTEXT);
|
||||
typedef int (WINAPI *GetThreadDpiAwarenessContext)();
|
||||
typedef DPI_AWARENESS_CONTEXT (WINAPI *GetThreadDpiAwarenessContext)();
|
||||
typedef BOOL (WINAPI *IsValidDpiAwarenessContext)(DPI_AWARENESS_CONTEXT);
|
||||
|
||||
// Windows pointer functions (Windows 8 or later).
|
||||
|
Loading…
Reference in New Issue
Block a user