Fix to support modern high DPI displays/laptops on Windows

Working on new editor enhancements?
AndyH
New User
New User
Posts: 4
Joined: Tue Nov 19, 2019 11:17 am

Fix to support modern high DPI displays/laptops on Windows

Post by AndyH »

Hi

Trialling PureBasic and it is unfortunately not usable on modern displays that use a higher than standard DPI for the display. Initially I though it was affecting only the icons which I can live without, but it also makes the properties window and form designer too difficult to use. This is how it appears on a Surface Pro:

Image

Good news
Requires a registry change. This is simple to do, but do at your own risk. Very easy to give yourself problems if you mess it up.

There is a hack that solves it. There's two steps:

1. Edit the registry, in this location:
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SideBySide

Add a DWORD called PreferExternalManifest and set the value to 1

2. Create a text file called PureBasic.exe.manifest and put it in the same location as the Pure Basic executable.

Edit the contents of the file to:

Code: Select all

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">

<dependency>
  <dependentAssembly>
    <assemblyIdentity
      type="win32"
      name="Microsoft.Windows.Common-Controls"
      version="6.0.0.0" processorArchitecture="*"
      publicKeyToken="6595b64144ccf1df"
      language="*">
    </assemblyIdentity>
  </dependentAssembly>
</dependency>

<dependency>
  <dependentAssembly>
    <assemblyIdentity
      type="win32"
      name="Microsoft.VC90.CRT"
      version="9.0.21022.8"
      processorArchitecture="amd64"
      publicKeyToken="1fc8b3b9a1e18e3b">
    </assemblyIdentity>
  </dependentAssembly>
</dependency>

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
  <security>
    <requestedPrivileges>
      <requestedExecutionLevel
        level="asInvoker"
        uiAccess="false"/>
    </requestedPrivileges>
  </security>
</trustInfo>

<asmv3:application>
  <asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
    <ms_windowsSettings:dpiAware xmlns:ms_windowsSettings="http://schemas.microsoft.com/SMI/2005/WindowsSettings">false</ms_windowsSettings:dpiAware>
  </asmv3:windowsSettings>
</asmv3:application>

</assembly>
PureBasic will now display correctly and everything is usable, although a little blurry.

Image

Obviously, only a workaround suitable for your own development. The programs you create will likely have the same problem and may need a similar fix. Searching the forums I can see that this is a common problem. Would hope the developers of PureBasic will support modern displays in Windows.
BarryG
Addict
Addict
Posts: 1628
Joined: Thu Apr 18, 2019 8:17 am

Re: Fix to support modern high DPI displays/laptops on Windo

Post by BarryG »

Thanks for this info; but rather than edit the Registry, can you try changing the compatibility settings for the exe to "Override high DPI scaling behavior –> System (Enhanced)" or one of the other DPI settings offered there? Should do the same thing for just that exe alone, without having to apply a global Registry change and creating a manifest file. I don't have a Surface Pro to test.

Image
Justin
Enthusiast
Enthusiast
Posts: 725
Joined: Sat Apr 26, 2003 2:49 pm

Re: Fix to support modern high DPI displays/laptops on Windo

Post by Justin »

The IDE is no longer DPI aware in 5.71, it was in 5.70 at least in Windows 7.
Maybe they screwed up the manifest?
I reported the bug here:
https://1/english/viewtopic.php?f=4&t=73895
But no one replied.
Fonts are really small on a 1080p 15" on a 4K 15" will be impossible to read.
AndyH
New User
New User
Posts: 4
Joined: Tue Nov 19, 2019 11:17 am

Re: Fix to support modern high DPI displays/laptops on Windo

Post by AndyH »

BarryG wrote:Thanks for this info; but rather than edit the Registry, can you try changing the compatibility settings for the exe to "Override high DPI scaling behavior –> System (Enhanced)" or one of the other DPI settings offered there? Should do the same thing for just that exe alone, without having to apply a global Registry change and creating a manifest file. I don't have a Surface Pro to test.

Image
Had already tried that without success. Seemed to have no effect.
AndyH
New User
New User
Posts: 4
Joined: Tue Nov 19, 2019 11:17 am

Re: Fix to support modern high DPI displays/laptops on Windo

Post by AndyH »

Btw, the registry part just enabled external manifests, Windows will look for a file with a matching name. I’ve had to use this to fix a slightly older version of photoshop.
Post Reply