From 6842fcaf448fa43c8592946682e5f6be19ce4bae Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Thu, 12 Jun 2025 16:30:54 +0800 Subject: [PATCH] Replace IntPtr.Zero with Handle or HWND --- Flow.Launcher.Infrastructure/Win32Helper.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index 9336ce44c..7c72d0857 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -282,7 +282,7 @@ namespace Flow.Launcher.Infrastructure { var hWndDesktop = PInvoke.FindWindowEx(hWnd, HWND.Null, "SHELLDLL_DefView", null); hWndDesktop = PInvoke.FindWindowEx(hWndDesktop, HWND.Null, "SysListView32", "FolderView"); - if (hWndDesktop.Value != IntPtr.Zero) + if (hWndDesktop != HWND.Null) { return false; } @@ -873,7 +873,7 @@ retry: // 4. Open that process hShellProcess = PInvoke.OpenProcess(PROCESS_ACCESS_RIGHTS.PROCESS_QUERY_INFORMATION, false, dwPID); - if (hShellProcess == IntPtr.Zero) + if (hShellProcess == HANDLE.Null) { errorInfo = $"Can't open desktop shell process: {Marshal.GetLastWin32Error()}"; return false;