From 4f74970e68915ed3cf1fab0ad45ef2c5a1d611c8 Mon Sep 17 00:00:00 2001 From: Markus Hofknecht Date: Sat, 24 Oct 2020 20:23:37 +0200 Subject: [PATCH] [BUG] Corrected DPI Awareness Mode (#143), version 1.0.17.5 --- NativeDllImport/SetProcessDPIAware.cs | 23 ----------------------- Properties/AssemblyInfo.cs | 4 ++-- Utilities/Scaling.cs | 8 -------- 3 files changed, 2 insertions(+), 33 deletions(-) delete mode 100644 NativeDllImport/SetProcessDPIAware.cs diff --git a/NativeDllImport/SetProcessDPIAware.cs b/NativeDllImport/SetProcessDPIAware.cs deleted file mode 100644 index 39a50ce..0000000 --- a/NativeDllImport/SetProcessDPIAware.cs +++ /dev/null @@ -1,23 +0,0 @@ -// -// Copyright (c) PlaceholderCompany. All rights reserved. -// - -namespace SystemTrayMenu.DllImports -{ - using System.Runtime.InteropServices; - - /// - /// wraps the methodcalls to native windows dll's. - /// - public static partial class NativeMethods - { - public static void User32SetProcessDPIAware() - { - _ = SetProcessDPIAware(); - } - - [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] - - private static extern bool SetProcessDPIAware(); - } -} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 18e8057..242cccd 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -39,5 +39,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.17.4")] -[assembly: AssemblyFileVersion("1.0.17.4")] +[assembly: AssemblyVersion("1.0.17.5")] +[assembly: AssemblyFileVersion("1.0.17.5")] diff --git a/Utilities/Scaling.cs b/Utilities/Scaling.cs index cd97281..f3d7f78 100644 --- a/Utilities/Scaling.cs +++ b/Utilities/Scaling.cs @@ -20,14 +20,6 @@ namespace SystemTrayMenu.Utilities internal static void Initialize() { CalculateScalingFactor(); - SetProcessDPIAwareWhenNecessary(); - static void SetProcessDPIAwareWhenNecessary() - { - if (Environment.OSVersion.Version.Major >= 6) - { - DllImports.NativeMethods.User32SetProcessDPIAware(); - } - } } private static void CalculateScalingFactor()