Win32Exception: 无效的窗口句柄。 --NativeErrorCode: 1400 StackTrace: 在 MS.Win32.UnsafeNativeMethods.GetWindowTextLength(HandleRef hWnd) 在 MS.Win32.UnsafeNativeMethods.GetWindowTextNoThrow(HandleRef hWnd, StringBuilder lpString, Int32 nMaxCount) 在 System.Windows.Automation.Peers.WindowAutomationPeer.GetNameCore() 在 System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree() 在 System.Windows.ContextLayoutManager.fireAutomationEvents() 在 System.Windows.ContextLayoutManager.UpdateLayout() 在 System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg) 在 System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() 在 System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget) 在 System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(Object resizedCompositionTarget) 在 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)