From bba71c37822077390bc7e5b2b62fb5d27fed287d Mon Sep 17 00:00:00 2001 From: Frank Skare Date: Sun, 23 May 2021 22:21:59 +0200 Subject: [PATCH] fix #249 --- src/Native/Native.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Native/Native.cs b/src/Native/Native.cs index 93d587f..2ba9dbf 100644 --- a/src/Native/Native.cs +++ b/src/Native/Native.cs @@ -149,7 +149,7 @@ namespace mpvnet public static int GetDPI(IntPtr hwnd) { - if (Environment.OSVersion.Version >= Windows_10_1607) + if (Environment.OSVersion.Version >= Windows_10_1607 && hwnd != IntPtr.Zero) return GetDpiForWindow(hwnd); else using (Graphics gx = Graphics.FromHwnd(hwnd))