This commit is contained in:
Frank Skare
2021-05-23 22:21:59 +02:00
parent eaa8a3ca6c
commit bba71c3782

View File

@@ -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))