diff --git a/ReVOSD/NativeMethods.txt b/ReVOSD/NativeMethods.txt index 664170e..4349219 100644 --- a/ReVOSD/NativeMethods.txt +++ b/ReVOSD/NativeMethods.txt @@ -5,7 +5,6 @@ SendMessage FindWindow GetWindowRgnBox -GetDpiForWindow CreateRectRgn SetWindowRgn diff --git a/ReVOSD/src/MediaOsd.cs b/ReVOSD/src/MediaOsd.cs index ae51df4..5acf712 100644 --- a/ReVOSD/src/MediaOsd.cs +++ b/ReVOSD/src/MediaOsd.cs @@ -8,7 +8,7 @@ using static Windows.Win32.PInvoke; using static Windows.Win32.System.SystemServices.APPCOMMAND_ID; -namespace ReMOSD; +namespace ReVOSD; class MediaOsd { @@ -27,14 +27,6 @@ public void SetRegion(HRGN value) if (result == 0) throw new Win32Exception(Marshal.GetLastWin32Error()); } - public uint GetDpi() - { - var dpi = GetDpiForWindow(HWnd); - if (dpi == 0) throw new Win32Exception(Marshal.GetLastWin32Error()); - - return dpi; - } - public static MediaOsd Find() { var shellHWnd = GetShellWindow(); diff --git a/ReVOSD/src/Program.cs b/ReVOSD/src/Program.cs index 2aa1c37..9d059e3 100644 --- a/ReVOSD/src/Program.cs +++ b/ReVOSD/src/Program.cs @@ -6,7 +6,7 @@ using static Windows.Win32.Graphics.Gdi.GDI_REGION_TYPE; using static Windows.Win32.PInvoke; -using ReMOSD; +using ReVOSD; AppDomain.CurrentDomain.UnhandledException += OnUnhandledException; @@ -19,11 +19,8 @@ // (see https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-getwindowrgn) if (osdRegion == RGN_ERROR) // Unchanged { - var osdScalingCoefficient = osd.GetDpi() / 96.0f; - newOsdRegion = CreateRectRgn(0, 0, - (int)Math.Round(65 * osdScalingCoefficient), - (int)Math.Round(140 * osdScalingCoefficient)); + 0, 0); if (newOsdRegion == default) throw new Win32Exception(Marshal.GetLastWin32Error()); } else // Reset @@ -38,7 +35,7 @@ static void OnUnhandledException(object s, UnhandledExceptionEventArgs e) var exception = e.ExceptionObject as Exception; AllocConsole(); - Console.Title = "ReMOSD"; + Console.Title = "ReVOSD"; Console.WriteLine(exception); Console.WriteLine();