High DPI solution for the Delphi 7 applications which includes embed Chromium (DCEF)
Posted: Sat Dec 19, 2020 2:36 pm
The Delphi7 applications can looks good in 4k monitors. The Windows 10 can help them. They're use 'DPI awareness' plus 'GDI scaling'. But if the application contains a component of the Chromium DCEF3 (or DCEF4 not matter), then collision occurs. Because to looks good the Chromium(DCEF) not need in 'GDI scaling' and 'DPI awareness'.
The simple way to switch the DPI apps by manifest file. For my app MShop.exe I've added the file MShop.exe.manifest:
In this case I've good scaling for application (large icons and control's text), but with bad(not need) scaling for HTML-editor (DCEF3 component's):
If I use another way to NO to 'DPI awareness' in the file MShop.exe.manifest (only changed lines):
In this case I've no(bad) scaling for application (small icons and control's text), but with no(good) scaling for HTML-editor (DCEF3 component's):
May be, a possible way is to add the second manifest file for the Chromium component which placed in file libcef.dll?
The simple way to switch the DPI apps by manifest file. For my app MShop.exe I've added the file MShop.exe.manifest:
Code: Select all
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="X86"
name="Melbis Shop"
type="win32"
/>
<asmv3:application>
<asmv3:windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/pm</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
<gdiScaling xmlns="http://schemas.microsoft.com/SMI/2017/WindowsSettings">true</gdiScaling>
</asmv3:windowsSettings>
</asmv3:application>
<description>Melbis Shop e-commerce</description>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="x86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges>
<requestedExecutionLevel
level="requireAdministrator"
uiAccess="false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Code: Select all
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">system</dpiAwareness>
May be, a possible way is to add the second manifest file for the Chromium component which placed in file libcef.dll?