[BUG] Corrected DPI Awareness Mode (#143), version 1.0.17.5

This commit is contained in:
Markus Hofknecht 2020-10-24 20:23:37 +02:00
parent 480b2636aa
commit 4f74970e68
3 changed files with 2 additions and 33 deletions

View file

@ -1,23 +0,0 @@
// <copyright file="SetProcessDPIAware.cs" company="PlaceholderCompany">
// Copyright (c) PlaceholderCompany. All rights reserved.
// </copyright>
namespace SystemTrayMenu.DllImports
{
using System.Runtime.InteropServices;
/// <summary>
/// wraps the methodcalls to native windows dll's.
/// </summary>
public static partial class NativeMethods
{
public static void User32SetProcessDPIAware()
{
_ = SetProcessDPIAware();
}
[DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
private static extern bool SetProcessDPIAware();
}
}

View file

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

View file

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