0

I have coded an application in Delphi XE2. I have updated to Delphi 10.2. When I compile my code, it seems that the user interface is very small. This happens in Windows 10. I am writing a blank app and everything seems great but the previous application seems tiny. I think it's about DPI support but the previous one that I coded in XE2 seems to be working great.

I think I have to change some settings, maybe in Application settings. But I couldn't find it yet.

If this question does not meet the requirements, I will delete it. I really don't want to make anyone mad.

EDIT: Here is my manifest file. As you stated, DPI is enabled. But doesn't it have to be?

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
  <dependency>
    <dependentAssembly>
      <assemblyIdentity
        type="win32"
        name="Microsoft.Windows.Common-Controls"
        version="6.0.0.0"
        publicKeyToken="6595b64144ccf1df"
        language="*"
        processorArchitecture="*"/>
    </dependentAssembly>
  </dependency>
  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
    <security>
      <requestedPrivileges>
        <requestedExecutionLevel
          level="asInvoker"
          uiAccess="false"/>
        </requestedPrivileges>
    </security>
  </trustInfo>
  <asmv3:application xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
    <asmv3:windowsSettings
         xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
      <dpiAware>true</dpiAware>
    </asmv3:windowsSettings>
  </asmv3:application>
</assembly>

Thanks

Don Coder
  • 526
  • 5
  • 24
  • Please check whether the application created with Delphi 10.2 has declared the app as "high DPI aware" in the manifest: [Delphi High DPI switch between own scaling and Windows scaling](https://stackoverflow.com/questions/40691809/delphi-high-dpi-switch-between-own-scaling-and-windows-scaling) – Olaf Hess Dec 14 '18 at 11:16
  • This is an incredibly complex area. Typically the application would appear tiny because you declared it to be DPI aware but then failed to respond to the DPI. Usually if you declare it to be not DPI aware then the system will scale the app for you. In that scenario you app will scale, but suffer from blurred text. What you need to do is read about DPI awareness in Windows, and do some experimentation with an empty application. – David Heffernan Dec 14 '18 at 11:28
  • @DavidHeffernan: He already tried with an empty application: "I am writing a blank app and everything seems great but the previous application seems tiny." – HeartWare Dec 14 '18 at 11:30
  • Thank you for all your comments. Yes DPI is enabled in a custom manifest. Setting it to false fixed the issue. But as @DavidHeffernan stated i think it will be blury. – Don Coder Dec 14 '18 at 11:47
  • 1
    @HeartWare I said, "do some experimentation". By which I mean to explore the impact of the various options, having first read about them. Learn the theory. Test your understanding of that theory by trying to put it into practice. – David Heffernan Dec 14 '18 at 12:05
  • Once you've enabled DPI Awareness, you should also make sure you have your forms' Scaled property set to True. – John Easley Dec 14 '18 at 22:24

1 Answers1

2

Perhaps this configuration item is set:

enter image description here

HeartWare
  • 7,464
  • 2
  • 26
  • 30
  • I have a custom manifest and it's like this: false – Don Coder Dec 14 '18 at 11:24
  • And you are sure that this manifest is actually included into the .EXE file? Try to extract it from the .EXE file and look at it after compiling the application. It may be that something interferes with this caused by the upgrade of the project file from XE2 to 10.2. – HeartWare Dec 14 '18 at 11:28
  • You can use this to view the embedded manifest: https://blogs.msdn.microsoft.com/mithuns/2009/12/16/random-how-to-quickly-view-a-binarys-embedded-manifest/ – HeartWare Dec 14 '18 at 11:28
  • when i removed that line it worked. But doesn't it have to be set to true? – Don Coder Dec 14 '18 at 11:38
  • Keep in mind there is also: dpiAwareness, It allows choosing a fallback DPI scaling option and overrides dpiAware. See: https://stackoverflow.com/questions/23551112/how-can-i-set-the-dpiaware-property-in-a-windows-application-manifest-to-per-mo/44009779 – Brian Dec 14 '18 at 12:58