How can I set Windows “DPI-scaling overrides” via a script?

不问归期 提交于 2020-01-03 06:26:34

问题


We have a Python-based application with a WxPython GUI that we create for multiple operating systems. In Windows 10, at least in my environment (inside a VM on a high resolution monitor), the text elements in the interface are blurry. I can improve the appearance by setting the Windows application DPI-scaling override. However, the only way I have found so far is to do it manually from the Windows file explorer interface.

My question: Is there a way to set this property from the command line, so that I can script this as part of building our application?


回答1:


in python code:

ctypes.windll.shcore.SetProcessDpiAwareness(1)

https://docs.microsoft.com/en-us/windows/desktop/api/shellscalingapi/nf-shellscalingapi-setprocessdpiawareness



来源:https://stackoverflow.com/questions/50884217/how-can-i-set-windows-dpi-scaling-overrides-via-a-script

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!