From 0a062c310a1386d9e7c9bbe4ad59e3927981ea96 Mon Sep 17 00:00:00 2001 From: stefnotch Date: Mon, 8 Aug 2022 19:19:05 +0200 Subject: [PATCH] Fix querying of explorer window --- Flow.Launcher/Helper/FileExplorerHelper.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher/Helper/FileExplorerHelper.cs b/Flow.Launcher/Helper/FileExplorerHelper.cs index 22c3de63f..c6d50f514 100644 --- a/Flow.Launcher/Helper/FileExplorerHelper.cs +++ b/Flow.Launcher/Helper/FileExplorerHelper.cs @@ -44,7 +44,8 @@ namespace Flow.Launcher.Helper // find the desired window and make sure that it is indeed a file explorer // we don't want the Internet Explorer or the classic control panel - if (Path.GetFileName((string)window.FullName) == "explorer.exe" && new IntPtr(window.HWND) == handle) + // ToLower() is needed, because Windows can report the path as "C:\\Windows\\Explorer.EXE" + if (Path.GetFileName((string)window.FullName).ToLower() == "explorer.exe" && new IntPtr(window.HWND) == handle) { return window; } @@ -53,8 +54,6 @@ namespace Flow.Launcher.Helper return null; } - // COM Imports - [DllImport("user32.dll")] private static extern IntPtr GetForegroundWindow(); }