Jump to content

making your compiled application DPI Aware


Recommended Posts

@Shark007: I'm wondering why the font size is larger than on my Win10 systems. Anyhow, can you please test this one?

It should display first an array with two entries. On my Win10 systems both entries are always .

Thx.

 

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

@Shark007

Ok, last try:

 

The manifest I used (modified):

<?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" >

	<!-- Identify the application security requirements. -->
	<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
		<security>
			<requestedPrivileges>
				<requestedExecutionLevel
 					level="asInvoker"
					uiAccess="false"
				/>
			</requestedPrivileges>
		</security>
	</trustInfo>

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

	<asmv3:application>
		<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
		      <dpiAware>true/pm</dpiAware>
		</asmv3:windowsSettings>
		<asmv3:windowsSettings xmlns="https://schemas.microsoft.com/SMI/2016/WindowsSettings">
		      <dpiAwareness>PerMonitorV2, system</dpiAwareness>
		</asmv3:windowsSettings>
		<asmv3:windowsSettings xmlns="https://schemas.microsoft.com/SMI/2017/WindowsSettings">
		      <gdiScaling>true</gdiScaling>
		</asmv3:windowsSettings>
	</asmv3:application>

	<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
		<application>
			<!--The ID below indicates application support for Windows Vista -->
			<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
			<!--The ID below indicates application support for Windows 7 -->
			<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
			<!--The ID below indicates application support for Windows 8 -->
			<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
			<!--The ID below indicates application support for Windows 8.1 -->
			<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
			<!--The ID below indicates application support for Windows 10 -->
			<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
		</application>
	</compatibility>
</assembly>

 

The source code is updated, too.

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

On both Windows 8.1(blue) and 10(grey), the app is Per Monitor Aware.

For my eyes, both systems displayed the GUI text to small. It is 50% of normal text seen on things such as desktop icons.

A perfect representation of what I see is depicted in the Windows 8 screenshot comparing the Window title to the Label text

4.jpg

3.jpg

2.jpg

1.jpg

Edited by Shark007
Link to comment
Share on other sites

@Shark007: I updated the code again. This is an example how to use it when PerMonitorAware is set. That means you have to control the size of the GUI / controls manually using GUIRegisterMsg($WM_DPICHANGED, "WM_DPICHANGED"). When you want to use system aware then you don't need WM_DPICHANGED but the result is more blurry.

I don't know yet if AutoIt3Wrapper will be updated that way...

 

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

If you have a look inside AutoitWrapper.au3 around line 2600, the code is already there but has been commented.

When I use Per Monitor aware on code that is already modified with $Scale to make the GUI display properly while using System Aware, the result is to small of a GUI but the ratio of text to gui does look correct. I wonder if it is possible to detect what awareness is in use and make further adjustments to $Scale to make that Per Monitor Aware GUI display correctly on the System viewing that gui.

Edited by Shark007
Link to comment
Share on other sites

  • Developers

That piece of code was commented out because there were still some issues with it. Any updates to that piece of code that would work for both old and new windows versions is welcome. :)

Jos

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

@Shark007 Did you run it by F5 or compiled? If compiled than it cannot be run properly as the manifest data is different than I'm using.

Edited by UEZ

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

I need to make much more tests using different DPI on different monitors using different DPI manifest settings using also child GUIs...

Please don't send me any personal message and ask for support! I will not reply!

Selection of finest graphical examples at Codepen.io

The own fart smells best!
Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Link to comment
Share on other sites

I am willing to assist you.

I have several readily available systems, Windows 7, 8.1 and 10 with a 1080p screen laptop and Windows 10 on my main desktop system with a 4k monitor,.

Just give me the systems/parameters you want set/tested

Link to comment
Share on other sites

On 8/5/2019 at 8:11 AM, Jos said:

That piece of code was commented out because there were still some issues with it. Any updates to that piece of code that would work for both old and new windows versions is welcome. :)

Jos

@Jos I would suggest expanding on the directive AutoIt3Wrapper presents.

such as 
#AutoIt3Wrapper_Res_HiDpi=Y (system aware)
#AutoIt3Wrapper_Res_HiDpi=P (per monitor aware)
#AutoIt3Wrapper_Res_HiDpi=P2 (per monitor aware V2)

The user could add all 3 if that fits their need - I am unsure if maybe their order of placement in the manifest could be significant to their use.

Maybe then can be placed into the manifest according to their placement in the script.

If you were to supply me with a modified  AutoIt3Wrapper, I'd be more than happy to test for you.

Edited by Shark007
Link to comment
Share on other sites

  • Developers

Somebody will first have to tell me exactly which codeshould be used for which option as I haven't tried to filter that from all posted information. So a management summary would be nice. :)

Jos

 

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

possible Manifest entries

<!--System Aware The 1st step in evolution, To be System Aware (Introduced in Windows 7, works on 8 and 10)-->
	<asmv3:application>
		<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
		      <dpiAware>true</dpiAware>
		</asmv3:windowsSettings>
	</asmv3:application>


<!--Per Monitor Aware (The 2nd step in evolution) Introduced with Windows 8.1 and works on 7 as System Aware, and on 8 and 10 as Per monitor Aware-->
	<asmv3:application>
		<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
		      <dpiAware>true/PM</dpiAware>
		</asmv3:windowsSettings>
	</asmv3:application>


<!--Windows 10 only. Per Monotor Aware Version 2 (The 3rd step in evolution)-->
	<asmv3:application>
		<asmv3:windowsSettings xmlns="https://schemas.microsoft.com/SMI/2016/WindowsSettings">
		      <dpiAwareness>PerMonitorV2</dpiAwareness>
		</asmv3:windowsSettings>
	</asmv3:application>


<!--Something I've only seen from EUZ. He seems pretty smart though, so I'm going to include it-->
	<asmv3:application>
		<asmv3:windowsSettings xmlns="https://schemas.microsoft.com/SMI/2017/WindowsSettings">
		      <gdiScaling>true</gdiScaling>
		</asmv3:windowsSettings>
	</asmv3:application>

 

Edited by Shark007
Link to comment
Share on other sites

@Jos  Another update after much more testing.

When you use #AutoIt3Wrapper_Res_HiDpi= (Y, N, P)

Y = True (System Aware)
N = Not Aware
P = Per Monitor Aware
and auto-selects the best one for the end user; such as PerMonitorV2 on later Windows 10 systems.

 

Edited by Shark007
change AutoitWrapper line #'s for new release
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...