diff --git a/Config/Config.cs b/Config/Config.cs index d3970c6..9388582 100644 --- a/Config/Config.cs +++ b/Config/Config.cs @@ -127,8 +127,20 @@ namespace SystemTrayMenu private static bool IsDarkModeActive() { // Check: AppsUseLightTheme (REG_DWORD) + bool isDarkModeActive = false; + object registryValueAppsUseLightTheme = Registry.GetValue( + "HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", + "AppsUseLightTheme", + 1); + // 0 = Dark mode, 1 = Light mode - return Registry.GetValue("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", "AppsUseLightTheme", 1).ToString() == "0"; + if (registryValueAppsUseLightTheme != null && + registryValueAppsUseLightTheme.ToString() == "0") + { + isDarkModeActive = true; + } + + return isDarkModeActive; } } } diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index e4f9ed6..bae796e 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -39,5 +39,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.17.8")] -[assembly: AssemblyFileVersion("1.0.17.8")] +[assembly: AssemblyVersion("1.0.17.9")] +[assembly: AssemblyFileVersion("1.0.17.9")]