Skip to content

Commit

Permalink
Windows: ignore missing SetProcessDPIAware() on Window XP
Browse files Browse the repository at this point in the history
  • Loading branch information
foone authored and BoboTiG committed Feb 23, 2019
1 parent 14d2214 commit 1f2b62e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mss/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ def __init__(self, **_):
self.user32.PROCESS_PER_MONITOR_DPI_AWARE
)
except AttributeError:
self.user32.SetProcessDPIAware()
try:
self.user32.SetProcessDPIAware()
except AttributeError:
pass # Windows XP doesn't have SetProcessDPIAware

self._srcdc = self.user32.GetWindowDC(0)
self._memdc = self.gdi32.CreateCompatibleDC(self._srcdc)
Expand Down

0 comments on commit 1f2b62e

Please sign in to comment.