Skip to content

Commit 1f2b62e

Browse files
fooneBoboTiG
authored andcommitted
Windows: ignore missing SetProcessDPIAware() on Window XP
1 parent 14d2214 commit 1f2b62e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

mss/windows.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@ def __init__(self, **_):
9292
self.user32.PROCESS_PER_MONITOR_DPI_AWARE
9393
)
9494
except AttributeError:
95-
self.user32.SetProcessDPIAware()
95+
try:
96+
self.user32.SetProcessDPIAware()
97+
except AttributeError:
98+
pass # Windows XP doesn't have SetProcessDPIAware
9699

97100
self._srcdc = self.user32.GetWindowDC(0)
98101
self._memdc = self.gdi32.CreateCompatibleDC(self._srcdc)

0 commit comments

Comments
 (0)