E1M1 Posted January 19, 2021 Share Posted January 19, 2021 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 More sharing options...
Shark007 Posted January 20, 2021 Share Posted January 20, 2021 maybe your answer is found here https://www.autoitscript.com/forum/topic/199786-making-your-compiled-application-dpi-aware/ TheDcoder 1 Link to comment Share on other sites More sharing options...
E1M1 Posted January 22, 2021 Author Share Posted January 22, 2021 Thanks! Just in case anyone arrives here from search engine. The solution was: DllCall("User32.dll", "bool", "SetProcessDPIAware") argumentum and TheDcoder 2 edited Link to comment Share on other sites More sharing options...
argumentum Posted February 7, 2021 Share Posted February 7, 2021 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. Link to comment Share on other sites More sharing options...
Shark007 Posted February 7, 2021 Share Posted February 7, 2021 (edited) _WinAPI_SetProcessDPIAwareness is a privately defined function possibly originating with the user, InnI My research reveals that It is not a working standard. Edited February 7, 2021 by Shark007 Link to comment Share on other sites More sharing options...
argumentum Posted February 7, 2021 Share Posted February 7, 2021 1 hour ago, Shark007 said: My research reveals that It is not a working standard It is recommended that you set the process-default DPI awareness via application manifest, not an API call. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting. Link to comment Share on other sites More sharing options...
Shark007 Posted February 7, 2021 Share Posted February 7, 2021 my research on this topic is posted here as previously linked in the 2nd post above. It has the insight you seek. argumentum 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now