diff --git a/src/Greenshot.Base/Core/DpiHelper.cs b/src/Greenshot.Base/Core/DpiHelper.cs index a9cbe9a34..d3c7e61b6 100644 --- a/src/Greenshot.Base/Core/DpiHelper.cs +++ b/src/Greenshot.Base/Core/DpiHelper.cs @@ -114,6 +114,10 @@ namespace Greenshot.Base.Core /// uint public static uint GetDpi(POINT location) { + if (!WindowsVersion.IsWindows81OrLater) + { + return DefaultScreenDpi; + } RECT rect = new RECT(location.X, location.Y, 1, 1); IntPtr hMonitor = User32.MonitorFromRect(ref rect, User32.MONITOR_DEFAULTTONEAREST); var result = GetDpiForMonitor(hMonitor, MonitorDpiType.EffectiveDpi, out var dpiX, out var dpiY); @@ -172,7 +176,7 @@ namespace Greenshot.Base.Core /// /// IntPtr /// uint with dpi - [DllImport("User32.dll")] + [DllImport("user32.dll")] private static extern uint GetDpiForWindow(IntPtr hWnd); /// @@ -193,7 +197,7 @@ namespace Greenshot.Base.Core /// Returns the system DPI. /// /// uint with the system DPI - [DllImport("User32.dll")] + [DllImport("user32.dll")] private static extern uint GetDpiForSystem(); } } \ No newline at end of file