-
-
Notifications
You must be signed in to change notification settings - Fork 744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unhandled File not found 0x80070002 in DwmGetColorizationParameters #593
Comments
The exception does not occur if you pass private void ApplyTheme()
{
try
{
Theme.Apply(_settings.DarkMode ? ThemeType.Dark : ThemeType.Light, WindowBackdropType, _updateAccentColor);
}
catch (FileNotFoundException)
{
if (_updateAccentColor)
{
_updateAccentColor = false;
ApplyTheme();
}
}
} Another way would be to determine the actual Windows version the error occurs on and implement a check for it's version number. This could probably be introduced into the actual code base also. I sadly can't do that as I got no systems to test on. |
There may be a problem with windows. When calling DwmGetColorizationParameters, you will encounter a 0x80070002 exception. |
Changing the colour theme and default windows mode (light/dark) in windows settings solves the problem for me |
I am randomly experiencing this issue while turning on/off high contrast or switching between high contrast modes |
DwmGetColorizationParameters fallback in case of failure #593
Describe the bug
The DWM api is throwing a
System.IO.FileNotFoundException
when accessingDwmapi.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
91a7089
Additional context
The text was updated successfully, but these errors were encountered: