Delphi project no longer DPI-aware via resource DLL

366 Views Asked by At

We have a Delphi project which is DPI-aware. We've achieved this, amongst other things, by including a manifest in the executable. This all works fine, the project scales nicely according to the DPI settings.

Recently we've begun translating our product, for which we are using Sisulizer. This tool has been configured to generate a resource DLL. The manifest is copied to the resource DLL by Sisulizer but is not translated. So the translations are working fine too :)

However, the translated project is no longer fully DPI-aware. MessageBoxes (from the Windows API) are still DPI-aware but the rest of the project no longer scales. The untranslated project is still DPI-aware.

1

There are 1 best solutions below

0
On

Issue has been resolved. The manifest was not the problem, it was an option in the Sisulizer-project: "Form scaling" was set to "Disable scaling", which caused the dfm to be changed in the resource DLL ("Scaled=False" was added). Changing it to "Ignore" resolved the issue.

When changing language from the GUI (so Screen.FormCount > 0) the scaling was not automatically set to the correct DPI. Or in other words: the forms are streamed from the resource DLL in their design-time state. We have fixed this by recording the scale factor for each form prior to switching to another language. Once the language has been changed (and all the forms have been translated) we re-apply the scale factor to the forms so everything shows up as expected.