Exception:无法将类型为“System.Windows.Interop.HwndTarget”的对象强制转换为类型“System.Windows.Interop.HwndSourceHook”。

报错信息 1
InvalidCastException: 无法将类型为“System.Windows.Interop.HwndTarget”的对象强制转换为类型“System.Windows.Interop.HwndSourceHook”。
StackTrace:
   在 System.Windows.Interop.HwndSource.PublicHooksFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

版本:1.44.22 2026-08-27 14:07 Microsoft Windows NT 10.0.17763.0