Open
Description
Describe the bug
The DWM api is throwing a System.IO.FileNotFoundException
when accessing Dwmapi.DwmGetColorizationParameters(out DWMCOLORIZATIONPARAMS dwParameters)
To Reproduce
Unknown
Expected behavior
The error is caught and a default color is applied
Screenshots
No response
OS version
Windows 10.0.22621
.NET version
.NET 6.0.16
WPF-UI NuGet version
Additional context
System.IO.FileNotFoundException: 系统找不到指定的文件。 (0x80070002)
?, in void Dwmapi.DwmGetColorizationParameters(out DWMCOLORIZATIONPARAMS dwParameters)
?, in Color UnsafeNativeMethods.GetDwmColor()
?, in void Theme.Apply(ThemeType themeType, WindowBackdropType backgroundEffect, bool updateAccent, bool forceBackground)
?, in void Watcher.UpdateThemes(SystemThemeType systemTheme)
?, in void Watcher.Watch(Window window, WindowBackdropType backgroundEffect, bool updateAccents, bool forceBackground)+(object sender, RoutedEventArgs args) => { }
?, in void RoutedEventHandlerInfo.InvokeHandler(object target, RoutedEventArgs routedEventArgs)
?, in void EventRoute.InvokeHandlersImpl(object source, RoutedEventArgs args, bool reRaised)
?, in void UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
?, in void UIElement.RaiseEvent(RoutedEventArgs e)
?, in void BroadcastEventHelper.BroadcastEvent(DependencyObject root, RoutedEvent routedEvent)
?, in object BroadcastEventHelper.BroadcastLoadedEvent(object root)
?, in void MediaContext.FireLoadedPendingCallbacks()
?, in void MediaContext.FireInvokeOnRenderCallbacks()
?, in void MediaContext.RenderMessageHandlerCore(object resizedCompositionTarget)
?, in object MediaContext.RenderMessageHandler(object resizedCompositionTarget)
?, in void MediaContext.Resize(ICompositionTarget resizedCompositionTarget)
?, in void HwndTarget.OnResize()
?, in IntPtr HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
?, in IntPtr HwndSource.HwndTargetFilterMessage(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
?, in IntPtr HwndWrapper.WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled)
?, in object HwndSubclass.DispatcherCallbackOperation(object o)
?, in object ExceptionWrapper.InternalRealCall(Delegate callback, object args, int numArgs)
?, in object ExceptionWrapper.TryCatchWhen(object source, Delegate callback, object args, int numArgs, Delegate catchHandler)
Activity