mirror of
https://github.com/python/cpython.git
synced 2025-10-07 07:31:46 +00:00
bpo-33656: Add enum name for argument of Windows call. (GH-7642)
Change suggested by Eryk Sun in a comment on PR 7137 after it was merged.
This commit is contained in:
parent
8a05f559ce
commit
fd88f319a4
1 changed files with 4 additions and 1 deletions
|
@ -9,10 +9,13 @@ except ImportError:
|
||||||
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
|
"Your Python may not be configured for Tk. **", file=sys.__stderr__)
|
||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
|
|
||||||
|
# Valid arguments for the ...Awareness call below are defined in the following.
|
||||||
|
# https://msdn.microsoft.com/en-us/library/windows/desktop/dn280512(v=vs.85).aspx
|
||||||
if sys.platform == 'win32':
|
if sys.platform == 'win32':
|
||||||
import ctypes
|
import ctypes
|
||||||
|
PROCESS_SYSTEM_DPI_AWARE = 1
|
||||||
try:
|
try:
|
||||||
ctypes.OleDLL('shcore').SetProcessDpiAwareness(1)
|
ctypes.OleDLL('shcore').SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE)
|
||||||
except (AttributeError, OSError):
|
except (AttributeError, OSError):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue