Skip to content

Commit e07f5ea

Browse files
committed
v1.4.2
性能提升
1 parent 6cb42ae commit e07f5ea

22 files changed

+476
-397
lines changed

Sources/SmartTaskbar.Win10/App.config

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@
1212
<startup>
1313
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
1414
</startup>
15+
<System.Windows.Forms.ApplicationConfigurationSection>
16+
<add key="DpiAwareness" value="PerMonitorV2" />
17+
</System.Windows.Forms.ApplicationConfigurationSection>
1518
<userSettings>
1619
<SmartTaskbar.Properties.Settings>
1720
<setting name="AutoModeType" serializeAs="String">

Sources/SmartTaskbar.Win10/Helpers/AnimationHelper.cs

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@ namespace SmartTaskbar
44
{
55
public static partial class Fun
66
{
7-
private const uint SpiGetMenuAnimation = 0x1002;
7+
private const uint TraySpiGetMenuAnimation = 0x1002;
88

9-
private const uint SpiSetMenuAnimation = 0x1003;
9+
private const uint TraySpiSetMenuAnimation = 0x1003;
1010

11-
private const uint UpdateAndSend = 3;
11+
private const uint TrayUpdateAndSend = 3;
1212

1313
/// <summary>
1414
/// Get taskbar animation status
1515
/// </summary>
1616
/// <returns></returns>
1717
public static bool IsEnableTaskbarAnimation()
1818
{
19-
_ = GetSystemParameters(SpiGetMenuAnimation, 0, out var animation, 0);
19+
_ = GetSystemParameters(TraySpiGetMenuAnimation, 0, out var animation, 0);
2020
return animation;
2121
}
2222

@@ -26,8 +26,11 @@ public static bool IsEnableTaskbarAnimation()
2626
/// <returns></returns>
2727
public static bool ChangeTaskbarAnimation()
2828
{
29-
_ = GetSystemParameters(SpiGetMenuAnimation, 0, out var animation, 0);
30-
_ = SetSystemParameters(SpiSetMenuAnimation, 0, animation ? IntPtr.Zero : (IntPtr) 1, UpdateAndSend);
29+
_ = GetSystemParameters(TraySpiGetMenuAnimation, 0, out var animation, 0);
30+
_ = SetSystemParameters(TraySpiSetMenuAnimation,
31+
0,
32+
animation ? IntPtr.Zero : (IntPtr) 1,
33+
TrayUpdateAndSend);
3134
return !animation;
3235
}
3336
}

Sources/SmartTaskbar.Win10/Helpers/AutoHideHelper.cs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ namespace SmartTaskbar
44
{
55
public static partial class Fun
66
{
7-
private const int AbsAutoHide = 1;
7+
private const int TrayAbsAutoHide = 1;
88

9-
private const int AbsAlwaysOnTop = 2;
9+
private const int TrayAbsAlwaysOnTop = 2;
1010

11-
private const uint AbmSetState = 10;
11+
private const uint TrayAbmSetState = 10;
1212

13-
private const uint AbmGetState = 4;
13+
private const uint TrayAbmGetState = 4;
1414
private static AppbarData _msg;
1515

1616
/// <summary>
@@ -21,21 +21,21 @@ public static void SetAutoHide()
2121
if (!IsNotAutoHide())
2222
return;
2323

24-
_msg.lParam = AbsAutoHide;
24+
_msg.lParam = TrayAbsAutoHide;
2525

26-
_ = SHAppBarMessage(AbmSetState, ref _msg);
26+
_ = SHAppBarMessage(TrayAbmSetState, ref _msg);
2727
}
2828

2929
public static bool IsNotAutoHide()
30-
=> SHAppBarMessage(AbmGetState, ref _msg) == IntPtr.Zero;
30+
=> SHAppBarMessage(TrayAbmGetState, ref _msg) == IntPtr.Zero;
3131

3232
/// <summary>
3333
/// Change Auto-Hide status
3434
/// </summary>
3535
public static void ChangeAutoHide()
3636
{
37-
_msg.lParam = IsNotAutoHide() ? AbsAutoHide : AbsAlwaysOnTop;
38-
_ = SHAppBarMessage(AbmSetState, ref _msg);
37+
_msg.lParam = IsNotAutoHide() ? TrayAbsAutoHide : TrayAbsAlwaysOnTop;
38+
_ = SHAppBarMessage(TrayAbmSetState, ref _msg);
3939
}
4040

4141
/// <summary>
@@ -46,9 +46,9 @@ public static void CancelAutoHide()
4646
if (IsNotAutoHide())
4747
return;
4848

49-
_msg.lParam = AbsAlwaysOnTop;
49+
_msg.lParam = TrayAbsAlwaysOnTop;
5050

51-
_ = SHAppBarMessage(AbmSetState, ref _msg);
51+
_ = SHAppBarMessage(TrayAbmSetState, ref _msg);
5252
}
5353
}
5454
}

Sources/SmartTaskbar.Win10/Helpers/ClassName.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.

0 commit comments

Comments
 (0)