Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 28acfb1

Browse files
fooneBoboTiG
authored andcommitted
Windows: ignore missing SetProcessDPIAware() on Window XP
1 parent c8a490f commit 28acfb1

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
@@ -89,7 +89,10 @@ def __init__(self):
8989
self.user32.PROCESS_PER_MONITOR_DPI_AWARE
9090
)
9191
except AttributeError:
92-
self.user32.SetProcessDPIAware()
92+
try:
93+
self.user32.SetProcessDPIAware()
94+
except AttributeError:
95+
pass # Windows XP doesn't have SetProcessDPIAware
9396

9497
self._srcdc = self.user32.GetWindowDC(0)
9598
self._memdc = self.gdi32.CreateCompatibleDC(self._srcdc)

0 commit comments

Comments
 (0)