mirror of
https://jihulab.com/DGP-Studio/Snap.Hutao.git
synced 2025-11-19 21:02:53 +08:00
fix #1845
This commit is contained in:
@@ -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<byte> span, out int patternLength)
|
||||
{
|
||||
// B9 3C 00 00 00 E8
|
||||
// mov ecx, 60 : B9 3C 00 00 00
|
||||
// call ...
|
||||
ReadOnlySpan<byte> part = [0xB9, 0x3C, 0x00, 0x00, 0x00, 0xE8];
|
||||
patternLength = part.Length;
|
||||
return span.IndexOf(part);
|
||||
|
||||
@@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user