Jump to content

How to disable high DPI scaling for autoit GUI?


E1M1
 Share

Recommended Posts

Hi!

 

When I use my autoit GUI with high DPI monitor, it gets blurry because of faulty scaling. How do I disable scaling for my GUI? I tried SetProcessDPIAwareness but it does not seem to work.
 

$__eDPIAWARNESS_Process_DPI_Unaware = 0
$__eDPIAWARNESS_Process_System_DPI_Aware = 1
$__eDPIAWARNESS_Process_Per_Monitor_DPI_Aware = 2

Func _WinAPI_SetProcessDPIAwareness($iPROCESS_DPI_AWARENESS)
    Return DllCall('Shcore.dll', 'int', 'SetProcessDPIAwareness', 'int', $iPROCESS_DPI_AWARENESS)
EndFunc   ;==>_WinAPI_SetProcessDPIAwareness

_WinAPI_SetProcessDPIAwareness($__eDPIAWARNESS_Process_Per_Monitor_DPI_Aware)

$gui =  GUICreate("Title")
GUICtrlCreateLabel("Hello World", 10, 10)
GUISetState(@SW_SHOW)

while GUIGetMsg() <> -3
WEnd

 

edited

Link to comment
Share on other sites

  • 3 weeks later...
On 1/22/2021 at 7:09 AM, E1M1 said:

The solution was...

if I do the DllCall from _WinAPI_SetProcessDPIAwareness() outside a function, right on the script, it works as expected. But somehow, not working within the function :(  

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...