mirror of
https://github.com/Hofknecht/SystemTrayMenu.git
synced 2024-05-19 20:03:25 +12:00
[BUG] Corrected DPI Awareness Mode (#143), version 1.0.17.5
This commit is contained in:
parent
480b2636aa
commit
4f74970e68
|
@ -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();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -39,5 +39,5 @@ using System.Runtime.InteropServices;
|
||||||
// You can specify all the values or you can default the Build and Revision Numbers
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
// [assembly: AssemblyVersion("1.0.*")]
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
[assembly: AssemblyVersion("1.0.17.4")]
|
[assembly: AssemblyVersion("1.0.17.5")]
|
||||||
[assembly: AssemblyFileVersion("1.0.17.4")]
|
[assembly: AssemblyFileVersion("1.0.17.5")]
|
||||||
|
|
|
@ -20,14 +20,6 @@ namespace SystemTrayMenu.Utilities
|
||||||
internal static void Initialize()
|
internal static void Initialize()
|
||||||
{
|
{
|
||||||
CalculateScalingFactor();
|
CalculateScalingFactor();
|
||||||
SetProcessDPIAwareWhenNecessary();
|
|
||||||
static void SetProcessDPIAwareWhenNecessary()
|
|
||||||
{
|
|
||||||
if (Environment.OSVersion.Version.Major >= 6)
|
|
||||||
{
|
|
||||||
DllImports.NativeMethods.User32SetProcessDPIAware();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void CalculateScalingFactor()
|
private static void CalculateScalingFactor()
|
||||||
|
|
Loading…
Reference in a new issue