This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Python 3.4.3 64 bits is not "high dpi aware"
Type: behavior Stage: resolved
Components: Windows Versions: Python 3.4, Python 3.5
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, cheryl.sabella, ivb, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2015-06-06 09:20 by ivb, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (6)
msg244894 - (view) Author: Ivan Bykov (ivb) Date: 2015-06-06 09:20
Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:44:40) [MSC v.1600 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> from ctypes import windll
>>> GetSystemMetrics = windll.user32.GetSystemMetrics
>>> GetSystemMetrics(SM_CYSCREEN)
>>> 'really this value is 1600'
>>> 'executable must be labeled as "high dpi aware"'
msg244995 - (view) Author: Ivan Bykov (ivb) Date: 2015-06-08 10:13

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
    <asmv3:windowsSettings xmlns="">
msg245053 - (view) Author: Ivan Bykov (ivb) Date: 2015-06-09 09:26
Python 3.5.0b2 (v3.5.0b2:7a088af5615b, May 31 2015, 06:22:19) [MSC v.1900 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import ctypes
>>> ctypes.windll.user32.GetSystemMetrics(1)
>>> #must be 1600
>>> #Python 3.5 also affected
msg245054 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2015-06-09 09:35
The Python program itself has no UI and cannot be marked as "DPI aware".

Instead, applications should call the win32 function "SetProcessDPIAwareness":
msg245058 - (view) Author: Ivan Bykov (ivb) Date: 2015-06-09 10:26
SetProcessDpiAwareness not available for Windows 7. For Windows 7 available SetProcessDPIAware, but:

Note  SetProcessDPIAware is subject to a possible *race* *condition* if a DLL caches dpi settings during initialization. For this reason, it is recommended that dpi-aware be set through the application (.exe) *manifest* rather than by calling SetProcessDPIAware.
msg332374 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2018-12-22 22:45
IDLE added a call to the Windows API in #33656.  Other than that, as Amaury stated, there isn't any UI in Python, so closing this as not a bug.
Date User Action Args
2022-04-11 14:58:17adminsetgithub: 68578
2018-12-22 22:45:15cheryl.sabellasetstatus: open -> closed

nosy: + cheryl.sabella
messages: + msg332374

resolution: not a bug
stage: resolved
2015-06-09 10:26:36ivbsetmessages: + msg245058
2015-06-09 09:35:53amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg245054
2015-06-09 09:26:08ivbsetmessages: + msg245053
versions: + Python 3.5
2015-06-08 10:13:16ivbsetmessages: + msg244995
2015-06-06 09:20:26ivbcreate