Skip to content

Commit 8cc2e41

Browse files
committed
Minor refactoring
1 parent 175ef82 commit 8cc2e41

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

ReMOSD/src/MediaOsd.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
using System;
22
using System.ComponentModel;
3-
using System.Runtime.InteropServices;
43
using System.Threading;
54

65
using Windows.Win32.Foundation;
@@ -24,13 +23,13 @@ public GDI_REGION_TYPE GetRegionBox(out RECT box)
2423
public void SetRegion(HRGN value)
2524
{
2625
var result = SetWindowRgn(HWnd, value, true);
27-
if (result == 0) throw new Win32Exception(Marshal.GetLastWin32Error());
26+
if (result == 0) throw new Win32Exception();
2827
}
2928

3029
public uint GetDpi()
3130
{
3231
var dpi = GetDpiForWindow(HWnd);
33-
if (dpi == 0) throw new Win32Exception(Marshal.GetLastWin32Error());
32+
if (dpi == 0) throw new Win32Exception();
3433

3534
return dpi;
3635
}

ReMOSD/src/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
newOsdRegion = CreateRectRgn(0, 0,
2525
(int)Math.Round(65 * osdScalingCoefficient),
2626
(int)Math.Round(140 * osdScalingCoefficient));
27-
if (newOsdRegion == default) throw new Win32Exception(Marshal.GetLastWin32Error());
27+
if (newOsdRegion == default) throw new Win32Exception();
2828
}
2929
else // Reset
3030
{

ReVOSD/src/MediaOsd.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public GDI_REGION_TYPE GetRegionBox(out RECT box)
2424
public void SetRegion(HRGN value)
2525
{
2626
var result = SetWindowRgn(HWnd, value, true);
27-
if (result == 0) throw new Win32Exception(Marshal.GetLastWin32Error());
27+
if (result == 0) throw new Win32Exception();
2828
}
2929

3030
public static MediaOsd Find()

ReVOSD/src/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
{
2222
newOsdRegion = CreateRectRgn(0, 0,
2323
0, 0);
24-
if (newOsdRegion == default) throw new Win32Exception(Marshal.GetLastWin32Error());
24+
if (newOsdRegion == default) throw new Win32Exception();
2525
}
2626
else // Reset
2727
{

0 commit comments

Comments
 (0)