diff --git a/ReMOSD/src/MediaOsd.cs b/ReMOSD/src/MediaOsd.cs index ae51df4..8ffa0b0 100644 --- a/ReMOSD/src/MediaOsd.cs +++ b/ReMOSD/src/MediaOsd.cs @@ -1,6 +1,5 @@ using System; using System.ComponentModel; -using System.Runtime.InteropServices; using System.Threading; using Windows.Win32.Foundation; @@ -24,13 +23,13 @@ public GDI_REGION_TYPE GetRegionBox(out RECT box) public void SetRegion(HRGN value) { var result = SetWindowRgn(HWnd, value, true); - if (result == 0) throw new Win32Exception(Marshal.GetLastWin32Error()); + if (result == 0) throw new Win32Exception(); } public uint GetDpi() { var dpi = GetDpiForWindow(HWnd); - if (dpi == 0) throw new Win32Exception(Marshal.GetLastWin32Error()); + if (dpi == 0) throw new Win32Exception(); return dpi; } diff --git a/ReMOSD/src/Program.cs b/ReMOSD/src/Program.cs index 2aa1c37..3e871b5 100644 --- a/ReMOSD/src/Program.cs +++ b/ReMOSD/src/Program.cs @@ -24,7 +24,7 @@ newOsdRegion = CreateRectRgn(0, 0, (int)Math.Round(65 * osdScalingCoefficient), (int)Math.Round(140 * osdScalingCoefficient)); - if (newOsdRegion == default) throw new Win32Exception(Marshal.GetLastWin32Error()); + if (newOsdRegion == default) throw new Win32Exception(); } else // Reset { diff --git a/ReVOSD/src/MediaOsd.cs b/ReVOSD/src/MediaOsd.cs index 5acf712..0799b79 100644 --- a/ReVOSD/src/MediaOsd.cs +++ b/ReVOSD/src/MediaOsd.cs @@ -24,7 +24,7 @@ public GDI_REGION_TYPE GetRegionBox(out RECT box) public void SetRegion(HRGN value) { var result = SetWindowRgn(HWnd, value, true); - if (result == 0) throw new Win32Exception(Marshal.GetLastWin32Error()); + if (result == 0) throw new Win32Exception(); } public static MediaOsd Find() diff --git a/ReVOSD/src/Program.cs b/ReVOSD/src/Program.cs index 9d059e3..4f2e63f 100644 --- a/ReVOSD/src/Program.cs +++ b/ReVOSD/src/Program.cs @@ -21,7 +21,7 @@ { newOsdRegion = CreateRectRgn(0, 0, 0, 0); - if (newOsdRegion == default) throw new Win32Exception(Marshal.GetLastWin32Error()); + if (newOsdRegion == default) throw new Win32Exception(); } else // Reset {