finally fix that Windows 32-bit crash

This commit is contained in:
tildearrow 2023-01-14 23:16:29 -05:00
parent f69917010a
commit 8746d36eac
3 changed files with 61 additions and 4 deletions

View file

@ -24,7 +24,8 @@
#ifdef _WIN32
#include <windows.h>
typedef HRESULT (*GDFM)(HMONITOR,int,UINT*,UINT*);
#include "shellScalingStub.h"
typedef HRESULT (WINAPI *GDFM)(HMONITOR,MONITOR_DPI_TYPE,UINT*,UINT*);
#endif
#ifdef __APPLE__
@ -71,9 +72,9 @@ double getScaleFactor(const char* driverHint) {
return 1.0;
}
unsigned int dpiX=96;
unsigned int dpiY=96;
HRESULT result=ta_GetDpiForMonitor(disp,0,&dpiX,&dpiY);
UINT dpiX=96;
UINT dpiY=96;
HRESULT result=ta_GetDpiForMonitor(disp,MDT_EFFECTIVE_DPI,&dpiX,&dpiY);
if (result!=S_OK) {
logW("GetDpiForMonitor failure (%.8x) - no scaling detection available!",result);