Win32Exception: 当前程序已使用了 Window 管理器对象的系统允许的所有句柄。
--NativeErrorCode: 1158
StackTrace:
在 MS.Win32.UnsafeNativeMethods.CreateWindowEx(Int32 dwExStyle, String lpszClassName, String lpszWindowName, Int32 style, Int32 x, Int32 y, Int32 width, Int32 height, HandleRef hWndParent, HandleRef hMenu, HandleRef hInst, Object pvParam)
在 MS.Win32.HwndWrapper..ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks)
在 System.Windows.SystemResources.CreateResourceChangeListenerWindow(DpiAwarenessContextValue dpiContextValue, Int32 x, Int32 y, String callerName)
在 System.Windows.SystemResources.EnsureResourceChangeListener(HwndDpiInfo hwndDpiInfo)
在 System.Windows.SystemResources.GetDpiAwarenessCompatibleNotificationWindow(HandleRef hwnd)
在 System.Windows.Interop.HwndHost.BuildOrReparentWindow()
在 System.Windows.Interop.HwndHost.OnSourceChanged(Object sender, SourceChangedEventArgs e)
在 System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
在 System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
在 System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
在 System.Windows.PresentationSource.UpdateSourceOfElement(DependencyObject doTarget, DependencyObject doAncestor, DependencyObject doOldParent)
在 System.Windows.PresentationSource.RootChanged(Visual oldRoot, Visual newRoot)
在 System.Windows.Interop.HwndSource.set_RootVisualInternal(Visual value)
在 System.Windows.Window.SourceWindowHelper.ClearRootVisual()
在 System.Windows.Window.CloseWindowFromWmClose()
在 System.Windows.Window.WmClose()
在 System.Windows.Window.WindowFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
在 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)