CtrlLib: Now using SetProcessDpiAwareness when available

git-svn-id: svn://ultimatepp.org/upp/trunk@11058 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2017-05-08 14:16:25 +00:00
parent fd35586a12
commit 520cf171b6

View file

@ -596,10 +596,17 @@ void ChSysInit()
ChReset();
XpClear();
BOOL (STDAPICALLTYPE * SetProcessDPIAware)(void);
DllFn(SetProcessDPIAware, "User32.dll", "SetProcessDPIAware");
if(SetProcessDPIAware && Ctrl::IsUHDEnabled())
(*SetProcessDPIAware)();
HRESULT (STDAPICALLTYPE *SetProcessDpiAwareness)(int);
DllFn(SetProcessDpiAwareness, "Shcore.dll", "SetProcessDpiAwareness");
if(SetProcessDpiAwareness)
SetProcessDpiAwareness(1);
else {
BOOL (STDAPICALLTYPE * SetProcessDPIAware)(void);
DllFn(SetProcessDPIAware, "User32.dll", "SetProcessDPIAware");
if(SetProcessDPIAware && Ctrl::IsUHDEnabled())
(*SetProcessDPIAware)();
}
NONCLIENTMETRICS ncm;
#if (WINVER >= 0x0600 && !defined(__MINGW32_VERSION))
ncm.cbSize = sizeof(ncm) - sizeof(ncm.iPaddedBorderWidth); // WinXP does not like it...