From 465108a9d487a0aee8d7bdb253a5e983bbfa715a Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sat, 22 Mar 2025 13:58:53 +0800 Subject: [PATCH] Fix keyboard layout fetch issue --- Flow.Launcher.Infrastructure/Win32Helper.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index 664f428ec..2248fadd6 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -371,9 +371,8 @@ namespace Flow.Launcher.Infrastructure if (enHKL == HKL.Null) return; // Get the current window thread ID - uint threadId = 0; - var result = PInvoke.GetWindowThreadProcessId(PInvoke.GetForegroundWindow(), &threadId); - if (result == 0 || threadId == 0) throw new Win32Exception(Marshal.GetLastWin32Error()); + var threadId = PInvoke.GetWindowThreadProcessId(PInvoke.GetForegroundWindow()); + if (threadId == 0) throw new Win32Exception(Marshal.GetLastWin32Error()); // Backup current keyboard layout if (backupPrevious)