5.73 - DPI Windows 10 - Surface Pro 7

Post bugreports for the Windows version here
User avatar
J. Baker
Addict
Addict
Posts: 2111
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

5.73 - DPI Windows 10 - Surface Pro 7

Post by J. Baker »

Yes, I have enabled DPI in the compiler options but it still always returns 1. No matter how you set Windows scaling.

Code: Select all

Debug "Desktop DPI 'x' factor: " + DesktopResolutionX()
EDIT:
Fix can be found in a few post below, viewtopic.php?p=571274#p571274
Last edited by J. Baker on Tue Jun 08, 2021 2:20 pm, edited 1 time in total.
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
User avatar
Saki
Addict
Addict
Posts: 830
Joined: Sun Apr 05, 2020 11:28 am
Location: Pandora

Re: 5.73 - DPI Windows 10 - Surface Pro 7

Post by Saki »

It is probably a misbehavior of the OS.
Not all scalings work.
However, as far as I know, it only affects scaling that can be called with any value.
The preset ones work, at least on the desktop PC.
Last edited by Saki on Tue Jun 08, 2021 4:06 pm, edited 1 time in total.
地球上の平和
User avatar
J. Baker
Addict
Addict
Posts: 2111
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: 5.73 - DPI Windows 10 - Surface Pro 7

Post by J. Baker »

If the current thread has a DPI_AWARENESS value of DPI_AWARENESS_UNAWARE, the return value will be 96.

Code: Select all

DLL = OpenLibrary(#PB_Any, "User32.dll")
	Debug CallFunction(DLL, "GetDpiForSystem")
CloseLibrary(DLL)
The code keeps returning 96 here.
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
User avatar
J. Baker
Addict
Addict
Posts: 2111
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: 5.73 - DPI Windows 10 - Surface Pro 7

Post by J. Baker »

This works with or without the compiler option. As you're setting it yourself. [Windows 10, version 1607]

Code: Select all

DLL = OpenLibrary(#PB_Any, "User32.dll")
	CallFunction(DLL, "SetThreadDpiAwarenessContext", -2)
	Debug CallFunction(DLL, "GetDpiForSystem")
CloseLibrary(DLL)
Last edited by J. Baker on Tue Jun 08, 2021 2:16 pm, edited 1 time in total.
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
fryquez
Enthusiast
Enthusiast
Posts: 192
Joined: Mon Dec 21, 2015 8:12 pm

Re: 5.73 - DPI Windows 10 - Surface Pro 7

Post by fryquez »

Could it be that you set a DPI Awareness compatibility mode option to the IDE? In that case this option would be inherited to the debugged app.

Check if the problem also occurs on compiled exe file.
User avatar
J. Baker
Addict
Addict
Posts: 2111
Joined: Sun Apr 27, 2003 8:12 am
Location: USA
Contact:

Re: 5.73 - DPI Windows 10 - Surface Pro 7

Post by J. Baker »

fryquez wrote: Tue Jun 08, 2021 2:14 pm Could it be that you set a DPI Awareness compatibility mode option to the IDE? In that case this option would be inherited to the debugged app.

Check if the problem also occurs on compiled exe file.
Yes, same occurs with compiled app. I posted a fix above your comment. Not sure if you saw that or not? It works for Windows 10.
www.posemotion.com

PureBasic Tools for OS X: PureMonitor, plist Tool, Data Maker & App Chef

Mac: 10.13.6 / 1.4GHz Core 2 Duo / 2GB DDR3 / Nvidia 320M
PC: Win 7 / AMD 64 4000+ / 3GB DDR / Nvidia 720GT


Even the vine knows it surroundings but the man with eyes does not.
Post Reply