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(); }