We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8029098 commit 7e9bffaCopy full SHA for 7e9bffa
1 file changed
src/pywinbox/_pywinbox_win.py
@@ -14,7 +14,11 @@
14
from ._main import Box
15
16
17
-dpiAware = ctypes.windll.user32.GetAwarenessFromDpiAwarenessContext(ctypes.windll.user32.GetThreadDpiAwarenessContext())
+try:
18
+ dpiAware = ctypes.windll.user32.GetAwarenessFromDpiAwarenessContext(ctypes.windll.user32.GetThreadDpiAwarenessContext())
19
+except AttributeError: # Windows server does not implement GetAwarenessFromDpiAwarenessContext
20
+ dpiAware = 0
21
+
22
if dpiAware == 0:
23
ctypes.windll.shcore.SetProcessDpiAwareness(2)
24
0 commit comments