From 588aba1395fb2e00cf6476c83d6a1a3cd86b282e Mon Sep 17 00:00:00 2001 From: qhy040404 Date: Sun, 28 Apr 2024 12:03:42 +0800 Subject: [PATCH] code style --- .../Snap.Hutao/Core/Windowing/WindowSubclass.cs | 2 +- src/Snap.Hutao/Snap.Hutao/Win32/User32.cs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Snap.Hutao/Snap.Hutao/Core/Windowing/WindowSubclass.cs b/src/Snap.Hutao/Snap.Hutao/Core/Windowing/WindowSubclass.cs index bc4e5552..4970c16e 100644 --- a/src/Snap.Hutao/Snap.Hutao/Core/Windowing/WindowSubclass.cs +++ b/src/Snap.Hutao/Snap.Hutao/Core/Windowing/WindowSubclass.cs @@ -48,7 +48,7 @@ internal sealed class WindowSubclass : IDisposable { windowProc = OnSubclassProcedure; bool windowHooked = SetWindowSubclass(options.Hwnd, windowProc, WindowSubclassId, 0); - bool propHooked = SetPropW(options.Hwnd, "NonRudeHWND", BOOL.TRUE); + bool propHooked = SetPropW(options.Hwnd, "NonRudeHWND", 1); hotKeyController.RegisterAll(); bool titleBarHooked = true; diff --git a/src/Snap.Hutao/Snap.Hutao/Win32/User32.cs b/src/Snap.Hutao/Snap.Hutao/Win32/User32.cs index 7226ab0e..5b10a02e 100644 --- a/src/Snap.Hutao/Snap.Hutao/Win32/User32.cs +++ b/src/Snap.Hutao/Snap.Hutao/Win32/User32.cs @@ -90,9 +90,9 @@ internal static class User32 public static extern HANDLE RemovePropW(HWND hWnd, PCWSTR lpString); [DebuggerStepThrough] - public static unsafe HANDLE RemovePropW(HWND hWnd, string str) + public static unsafe HANDLE RemovePropW(HWND hWnd, string @string) { - fixed (char* lpString = str) + fixed (char* lpString = @string) { return RemovePropW(hWnd, lpString); } @@ -117,12 +117,12 @@ internal static class User32 [DllImport("USER32.dll", CallingConvention = CallingConvention.Winapi, CharSet = CharSet.Unicode, ExactSpelling = true, SetLastError = true)] [SupportedOSPlatform("windows5.0")] - public static extern BOOL SetPropW(HWND hWnd, PCWSTR lpString, [AllowNull] nint hData); + public static extern BOOL SetPropW(HWND hWnd, PCWSTR lpString, [AllowNull] HANDLE hData); [DebuggerStepThrough] - public static unsafe BOOL SetPropW(HWND hWnd, string str, [AllowNull] nint hData) + public static unsafe BOOL SetPropW(HWND hWnd, string @string, [AllowNull] HANDLE hData) { - fixed (char* lpString = str) + fixed (char* lpString = @string) { return SetPropW(hWnd, lpString, hData); }