Skip to content

Commit

Permalink
Merge pull request #861 from cjee21/DPI-fix
Browse files Browse the repository at this point in the history
Windows GUI: Use older API for getting system DPI, update2
  • Loading branch information
JeromeMartinez authored Jun 1, 2024
2 parents 80dc38b + 498de2d commit bbfebe6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions Project/BCB/GUI/MediaInfo_GUI.cbproj
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
<Manifest_File>$(BDS)\bin\default_app.manifest</Manifest_File>
<AppDPIAwarenessMode>PerMonitorV2</AppDPIAwarenessMode>
<Icon_MainIcon>..\..\..\Source\Resource\Image\MediaInfo.ico</Icon_MainIcon>
<ILINK_DelayLoadDll>user32.dll;$(ILINK_DelayLoadDll)</ILINK_DelayLoadDll>
</PropertyGroup>
<ItemGroup>
<LibFiles Condition="'$(Platform)'=='Win32'" Include="$(BDSLIB)\win32\release\wininet.lib">
Expand Down
4 changes: 2 additions & 2 deletions Source/GUI/VCL/GUI_Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ void __fastcall TMainF::GUI_Configure()
osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osvi);
int DPI;
if (osvi.dwMajorVersion >= 10 && (osvi.dwMajorVersion > 10 || osvi.dwMinorVersion > 0 || osvi.dwBuildNumber >= 17134))
DPI=GetDeviceCaps(GetDC(NULL), LOGPIXELSX); // GetSystemDpiForProcess(GetCurrentProcess());
if (osvi.dwMajorVersion >= 10 && (osvi.dwMajorVersion > 10 || osvi.dwMinorVersion > 0 || osvi.dwBuildNumber >= 14939))
DPI=GetDpiForWindow(WindowHandle);
else
DPI=GetDeviceCaps(GetDC(NULL), LOGPIXELSX);
float DPIScale=static_cast<float>(DPI)/96;
Expand Down

0 comments on commit bbfebe6

Please sign in to comment.