diff --git a/src/Snap.Hutao/Snap.Hutao/Service/Game/Unlocker/GameFpsAddress.cs b/src/Snap.Hutao/Snap.Hutao/Service/Game/Unlocker/GameFpsAddress.cs index 022d99e3..a7d37a95 100644 --- a/src/Snap.Hutao/Snap.Hutao/Service/Game/Unlocker/GameFpsAddress.cs +++ b/src/Snap.Hutao/Snap.Hutao/Service/Game/Unlocker/GameFpsAddress.cs @@ -29,7 +29,7 @@ internal static class GameFpsAddress offsetToExecutable += index; nuint rip = localModule.Executable.Address + (uint)offsetToExecutable; - rip += 5U; + rip += 5U; // advanced to [call jumpCall] rip += (nuint)(*(int*)(rip + 1U) + 5); if (*(byte*)rip is ASM_JMP) @@ -57,6 +57,8 @@ internal static class GameFpsAddress private static int IndexOfPattern(in ReadOnlySpan span, out int patternLength) { // B9 3C 00 00 00 E8 + // mov ecx, 60 : B9 3C 00 00 00 + // call ... ReadOnlySpan part = [0xB9, 0x3C, 0x00, 0x00, 0x00, 0xE8]; patternLength = part.Length; return span.IndexOf(part); diff --git a/src/Snap.Hutao/Snap.Hutao/UI/Shell/NotifyIconXamlHostWindow.cs b/src/Snap.Hutao/Snap.Hutao/UI/Shell/NotifyIconXamlHostWindow.cs index 7e666b40..a32f3b28 100644 --- a/src/Snap.Hutao/Snap.Hutao/UI/Shell/NotifyIconXamlHostWindow.cs +++ b/src/Snap.Hutao/Snap.Hutao/UI/Shell/NotifyIconXamlHostWindow.cs @@ -22,8 +22,8 @@ internal sealed class NotifyIconXamlHostWindow : Window, IWindowNeedEraseBackgro { Content = new Border(); - this.SetLayered(); - this.SetToolWindow(); + this.SetExStyleLayered(); + this.SetExStyleToolWindow(); AppWindow.Title = "SnapHutaoNotifyIconXamlHost"; AppWindow.IsShownInSwitchers = false; @@ -54,7 +54,7 @@ internal sealed class NotifyIconXamlHostWindow : Window, IWindowNeedEraseBackgro flyout.ShowAt(Content, new() { Placement = FlyoutPlacementMode.Auto, - ShowMode = FlyoutShowMode.Transient, + ShowMode = FlyoutShowMode.Standard, }); } diff --git a/src/Snap.Hutao/Snap.Hutao/UI/Xaml/WindowExtension.cs b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/WindowExtension.cs index 002d00b9..3e1d593b 100644 --- a/src/Snap.Hutao/Snap.Hutao/UI/Xaml/WindowExtension.cs +++ b/src/Snap.Hutao/Snap.Hutao/UI/Xaml/WindowExtension.cs @@ -84,7 +84,7 @@ internal static class WindowExtension ShowWindow(window.GetWindowHandle(), SHOW_WINDOW_CMD.SW_HIDE); } - public static void SetLayered(this Window window, bool full = true) + public static void SetExStyleLayered(this Window window, bool full = true) { HWND hwnd = (HWND)WindowNative.GetWindowHandle(window); nint style = GetWindowLongPtrW(hwnd, WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE); @@ -97,7 +97,7 @@ internal static class WindowExtension } } - public static void SetToolWindow(this Window window) + public static void SetExStyleToolWindow(this Window window) { HWND hwnd = (HWND)WindowNative.GetWindowHandle(window); nint style = GetWindowLongPtrW(hwnd, WINDOW_LONG_PTR_INDEX.GWL_EXSTYLE); diff --git a/src/Snap.Hutao/Snap.Hutao/Web/Request/Builder/HttpRequestMessageBuilderExtension.cs b/src/Snap.Hutao/Snap.Hutao/Web/Request/Builder/HttpRequestMessageBuilderExtension.cs index 5e5fb068..02b1a3fa 100644 --- a/src/Snap.Hutao/Snap.Hutao/Web/Request/Builder/HttpRequestMessageBuilderExtension.cs +++ b/src/Snap.Hutao/Snap.Hutao/Web/Request/Builder/HttpRequestMessageBuilderExtension.cs @@ -72,6 +72,10 @@ internal static class HttpRequestMessageBuilderExtension ProcessException(messageBuilder, ex); logger.LogWarning(ex, RequestErrorMessage, builder.RequestUri); } + catch (OperationCanceledException) + { + showInfo = false; + } catch (Exception ex) { ProcessException(messageBuilder, ex);