Skip to content

armgit / Filee

Public Imported from GitHub
0

Free, open-source file converter. Convert 263 formats offline by drag & drop — images, PDF, Word, Excel, PowerPoint, HWP/HWPX, video, audio, e-books and archives. No upload, no Office needed.

Don't let a shell window that answers no names stop a selection gesture

KnifeLemon131bf68ebfd4
diff --git a/src/Filee.Platform.Windows/WindowsPlatformServices.cs b/src/Filee.Platform.Windows/WindowsPlatformServices.cs
index 39549178..ea5b50ff 100644
--- a/src/Filee.Platform.Windows/WindowsPlatformServices.cs
+++ b/src/Filee.Platform.Windows/WindowsPlatformServices.cs
@@ -141,7 +141,7 @@ public sealed class WindowsPlatformServices : IPlatformServices
});
}
catch (Exception ex) when (ex is COMException or InvalidOperationException or InvalidCastException
- or Microsoft.CSharp.RuntimeBinder.RuntimeBinderException)
+ or Microsoft.CSharp.RuntimeBinder.RuntimeBinderException or MissingMemberException)
{
// No Explorer desktop (another shell, Explorer restarting): nothing selected to read.
return [];
@@ -195,6 +195,8 @@ public sealed class WindowsPlatformServices : IPlatformServices
}
catch (COMException) { }
catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException) { } // e.g. Internet Explorer windows
+ // "Could not get dispatch ID for HWND (error: 0x8000FFFF)": a shell window that answers no names (#606).
+ catch (MissingMemberException) { }
found.Add(window);
entries.Add(new ShellWindowEntry(topLevel, tab));
}
@@ -213,9 +215,11 @@ public sealed class WindowsPlatformServices : IPlatformServices
}
catch (COMException) { }
catch (Microsoft.CSharp.RuntimeBinder.RuntimeBinderException) { } // e.g. Internet Explorer windows
+ // The same for Document (#606).
+ catch (MissingMemberException) { }
}
}
- catch (COMException)
+ catch (Exception ex) when (ex is COMException or Microsoft.CSharp.RuntimeBinder.RuntimeBinderException or MissingMemberException)
{
}
finally