Melon-Studio / DarkMode2

Windows10/11 automatically switch color mode tool.
GNU General Public License v3.0
253 stars 9 forks source link

感光模式无法关闭 #19

Closed Little-Data closed 1 year ago

Little-Data commented 1 year ago

系统信息:

Win11 22H2 22621.1992 64位
.net版本:7.0.9

打开感光模式开关,注册表PhotosensitiveMode值改变,同时有下面的报错信息:

有关调用实时(JIT)调试而不是此对话框的详细信息,
请参见此消息的结尾。

************** 异常文本 **************
System.ArgumentException: 无效的基。
   在 System.Convert.ToInt32(String value, Int32 fromBase)
   在 DarkMode_2.Models.SwitchMode.switchMode(String mode) 位置 G:\Project\C#\DarkMode_2\Models\SwitchMode.cs:行号 95
   在 DarkMode_2.Views.MainWindow.SwitchService(Object myObject, EventArgs myEventArgs) 位置 G:\Project\C#\DarkMode_2\Views\MainWindow.xaml.cs:行号 271
   在 System.Windows.Forms.Timer.OnTick(EventArgs e)
   在 System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
   在 System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** 已加载的程序集 **************
mscorlib
    程序集版本:4.0.0.0
    Win32 版本:4.8.9167.0 built by: NET481REL1LAST_B
    基本代码:file:///C:/Windows/Microsoft.NET/Framework64/v4.0.30319/mscorlib.dll
----------------------------------------
DarkMode 2
    程序集版本:2.1.0.0
    Win32 版本:2.1.0.0
    基本代码:file:///D:/software/DarkMode2/DarkMode%202.exe
----------------------------------------
PresentationFramework
    程序集版本:4.0.0.0
    Win32 版本:4.8.9166.0
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.dll
----------------------------------------
WindowsBase
    程序集版本:4.0.0.0
    Win32 版本:4.8.9166.0 built by: NET481REL1LAST_B
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/WindowsBase/v4.0_4.0.0.0__31bf3856ad364e35/WindowsBase.dll
----------------------------------------
System.Core
    程序集版本:4.0.0.0
    Win32 版本:4.8.9166.0 built by: NET481REL1LAST_B
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System
    程序集版本:4.0.0.0
    Win32 版本:4.8.9166.0 built by: NET481REL1LAST_B
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
PresentationCore
    程序集版本:4.0.0.0
    Win32 版本:4.8.9166.0 built by: NET481REL1LAST_B
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_64/PresentationCore/v4.0_4.0.0.0__31bf3856ad364e35/PresentationCore.dll
----------------------------------------
System.Xaml
    程序集版本:4.0.0.0
    Win32 版本:4.8.9166.0 built by: NET481REL1LAST_B
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xaml/v4.0_4.0.0.0__b77a5c561934e089/System.Xaml.dll
----------------------------------------
Microsoft.Extensions.Hosting
    程序集版本:6.0.0.1
    Win32 版本:6.0.222.6406
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Hosting.DLL
----------------------------------------
Microsoft.Extensions.Hosting.Abstractions
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Hosting.Abstractions.DLL
----------------------------------------
Microsoft.Extensions.Configuration.Abstractions
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Configuration.Abstractions.DLL
----------------------------------------
Microsoft.Extensions.DependencyInjection.Abstractions
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.DependencyInjection.Abstractions.DLL
----------------------------------------
Microsoft.Extensions.DependencyInjection
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.DependencyInjection.DLL
----------------------------------------
Microsoft.Extensions.Logging
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Logging.DLL
----------------------------------------
System.Diagnostics.DiagnosticSource
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/System.Diagnostics.DiagnosticSource.DLL
----------------------------------------
Microsoft.Extensions.Configuration
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Configuration.DLL
----------------------------------------
Microsoft.Extensions.Configuration.EnvironmentVariables
    程序集版本:6.0.0.1
    Win32 版本:6.0.222.6406
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Configuration.EnvironmentVariables.DLL
----------------------------------------
Microsoft.Extensions.Configuration.CommandLine
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Configuration.CommandLine.DLL
----------------------------------------
Microsoft.Extensions.Primitives
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Primitives.DLL
----------------------------------------
Microsoft.Extensions.FileProviders.Physical
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.FileProviders.Physical.DLL
----------------------------------------
Microsoft.Extensions.FileProviders.Abstractions
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.FileProviders.Abstractions.DLL
----------------------------------------
Microsoft.Extensions.Configuration.FileExtensions
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Configuration.FileExtensions.DLL
----------------------------------------
Microsoft.Extensions.Configuration.Json
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Configuration.Json.DLL
----------------------------------------
Microsoft.Extensions.Configuration.UserSecrets
    程序集版本:6.0.0.1
    Win32 版本:6.0.222.6406
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Configuration.UserSecrets.DLL
----------------------------------------
Microsoft.Extensions.Configuration.Binder
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Configuration.Binder.DLL
----------------------------------------
Microsoft.Extensions.FileSystemGlobbing
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.FileSystemGlobbing.DLL
----------------------------------------
System.Memory
    程序集版本:4.0.1.1
    Win32 版本:4.6.28619.01
    基本代码:file:///D:/software/DarkMode2/System.Memory.DLL
----------------------------------------
System.Runtime.CompilerServices.Unsafe
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/System.Runtime.CompilerServices.Unsafe.DLL
----------------------------------------
Microsoft.Extensions.Options
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Options.DLL
----------------------------------------
Microsoft.Extensions.Logging.Abstractions
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Logging.Abstractions.DLL
----------------------------------------
System.Runtime.InteropServices.RuntimeInformation
    程序集版本:4.0.0.0
    Win32 版本:4.8.9032.0
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.InteropServices.RuntimeInformation/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Runtime.InteropServices.RuntimeInformation.dll
----------------------------------------
Microsoft.Extensions.Logging.Configuration
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Logging.Configuration.DLL
----------------------------------------
Microsoft.Extensions.Logging.Console
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Logging.Console.DLL
----------------------------------------
Microsoft.Extensions.Logging.Debug
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Logging.Debug.DLL
----------------------------------------
Microsoft.Extensions.Logging.EventSource
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Logging.EventSource.DLL
----------------------------------------
Microsoft.Extensions.Logging.EventLog
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Logging.EventLog.DLL
----------------------------------------
Microsoft.Extensions.Options.ConfigurationExtensions
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Extensions.Options.ConfigurationExtensions.DLL
----------------------------------------
System.Text.Json
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/System.Text.Json.DLL
----------------------------------------
System.Text.Encodings.Web
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/System.Text.Encodings.Web.DLL
----------------------------------------
Wpf.Ui
    程序集版本:2.0.3.0
    Win32 版本:2.0.3.0
    基本代码:file:///D:/software/DarkMode2/Wpf.Ui.DLL
----------------------------------------
Microsoft.Toolkit.Mvvm
    程序集版本:7.1.0.0
    Win32 版本:7.1.2.1
    基本代码:file:///D:/software/DarkMode2/Microsoft.Toolkit.Mvvm.DLL
----------------------------------------
netstandard
    程序集版本:2.0.0.0
    Win32 版本:4.8.9032.0
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/netstandard/v4.0_2.0.0.0__cc7b13ffcd2ddd51/netstandard.dll
----------------------------------------
Microsoft.Bcl.AsyncInterfaces
    程序集版本:6.0.0.0
    Win32 版本:6.0.21.52210
    基本代码:file:///D:/software/DarkMode2/Microsoft.Bcl.AsyncInterfaces.DLL
----------------------------------------
System.Threading.Tasks.Extensions
    程序集版本:4.2.0.1
    Win32 版本:4.6.28619.01
    基本代码:file:///D:/software/DarkMode2/System.Threading.Tasks.Extensions.DLL
----------------------------------------
System.ValueTuple
    程序集版本:4.0.0.0
    Win32 版本:4.8.9032.0
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.ValueTuple/v4.0_4.0.0.0__cc7b13ffcd2ddd51/System.ValueTuple.dll
----------------------------------------
System.Configuration
    程序集版本:4.0.0.0
    Win32 版本:4.8.9032.0 built by: NET481REL1
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
    程序集版本:4.0.0.0
    Win32 版本:4.8.9032.0 built by: NET481REL1
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
PresentationFramework.Aero2
    程序集版本:4.0.0.0
    Win32 版本:4.8.9032.0 built by: NET481REL1
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework.Aero2/v4.0_4.0.0.0__31bf3856ad364e35/PresentationFramework.Aero2.dll
----------------------------------------
System.Windows.Controls.Ribbon
    程序集版本:4.0.0.0
    Win32 版本:4.8.9166.0
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Controls.Ribbon/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Controls.Ribbon.dll
----------------------------------------
System.Windows.Forms
    程序集版本:4.0.0.0
    Win32 版本:4.8.9075.0 built by: NET481REL1LAST_C
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
    程序集版本:4.0.0.0
    Win32 版本:4.8.9032.0 built by: NET481REL1
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
NHotkey.Wpf
    程序集版本:2.0.0.0
    Win32 版本:2.1.0.0
    基本代码:file:///D:/software/DarkMode2/NHotkey.Wpf.DLL
----------------------------------------
NHotkey
    程序集版本:2.0.0.0
    Win32 版本:2.1.0.0
    基本代码:file:///D:/software/DarkMode2/NHotkey.DLL
----------------------------------------
Windows.Devices
    程序集版本:255.255.255.255
    Win32 版本:10.0.10011.16384
    基本代码:file:///C:/Windows/system32/WinMetadata/Windows.Devices.winmd
----------------------------------------
Windows.Foundation
    程序集版本:255.255.255.255
    Win32 版本:10.0.10011.16384
    基本代码:file:///C:/Windows/system32/WinMetadata/Windows.Foundation.winmd
----------------------------------------
System.Runtime.InteropServices.WindowsRuntime
    程序集版本:4.0.0.0
    Win32 版本:4.8.9032.0
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.InteropServices.WindowsRuntime/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Runtime.InteropServices.WindowsRuntime.dll
----------------------------------------
mscorlib.resources
    程序集版本:4.0.0.0
    Win32 版本:4.8.9032.0 built by: NET481REL1
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/mscorlib.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/mscorlib.resources.dll
----------------------------------------
System.Management
    程序集版本:4.0.0.0
    Win32 版本:4.8.9032.0 built by: NET481REL1
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
----------------------------------------
PresentationCore.resources
    程序集版本:4.0.0.0
    Win32 版本:4.8.9032.0 built by: NET481REL1
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationCore.resources/v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35/PresentationCore.resources.dll
----------------------------------------
PresentationFramework-SystemXml
    程序集版本:4.0.0.0
    Win32 版本:4.8.9032.0
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework-SystemXml/v4.0_4.0.0.0__b77a5c561934e089/PresentationFramework-SystemXml.dll
----------------------------------------
System.Buffers
    程序集版本:4.0.3.0
    Win32 版本:4.6.28619.01
    基本代码:file:///D:/software/DarkMode2/System.Buffers.DLL
----------------------------------------
Microsoft.Toolkit.Uwp.Notifications
    程序集版本:7.1.0.0
    Win32 版本:7.1.2.1
    基本代码:file:///D:/software/DarkMode2/Microsoft.Toolkit.Uwp.Notifications.DLL
----------------------------------------
Windows.UI
    程序集版本:255.255.255.255
    Win32 版本:10.0.10011.16384
    基本代码:file:///C:/Windows/system32/WinMetadata/Windows.UI.winmd
----------------------------------------
System.Runtime
    程序集版本:4.0.0.0
    Win32 版本:4.8.9032.0
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Runtime.dll
----------------------------------------
Windows.Data
    程序集版本:255.255.255.255
    Win32 版本:10.0.10011.16384
    基本代码:file:///C:/Windows/system32/WinMetadata/Windows.Data.winmd
----------------------------------------
Windows.ApplicationModel
    程序集版本:255.255.255.255
    Win32 版本:10.0.10011.16384
    基本代码:file:///C:/Windows/system32/WinMetadata/Windows.ApplicationModel.winmd
----------------------------------------
System.Runtime.WindowsRuntime
    程序集版本:4.0.0.0
    Win32 版本:4.8.9032.0 built by: NET481REL1
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Runtime.WindowsRuntime/v4.0_4.0.0.0__b77a5c561934e089/System.Runtime.WindowsRuntime.dll
----------------------------------------
Windows.Storage
    程序集版本:255.255.255.255
    Win32 版本:10.0.10011.16384
    基本代码:file:///C:/Windows/system32/WinMetadata/Windows.Storage.winmd
----------------------------------------
DynamicComActivator
    程序集版本:0.0.0.0
    Win32 版本:7.1.2.1
    基本代码:file:///D:/software/DarkMode2/Microsoft.Toolkit.Uwp.Notifications.dll
----------------------------------------
UIAutomationProvider
    程序集版本:4.0.0.0
    Win32 版本:4.8.9166.0 built by: NET481REL1LAST_B
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/UIAutomationProvider/v4.0_4.0.0.0__31bf3856ad364e35/UIAutomationProvider.dll
----------------------------------------
UIAutomationTypes
    程序集版本:4.0.0.0
    Win32 版本:4.8.9166.0 built by: NET481REL1LAST_B
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/UIAutomationTypes/v4.0_4.0.0.0__31bf3856ad364e35/UIAutomationTypes.dll
----------------------------------------
Accessibility
    程序集版本:4.0.0.0
    Win32 版本:4.8.9032.0 built by: NET481REL1
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/Accessibility/v4.0_4.0.0.0__b03f5f7f11d50a3a/Accessibility.dll
----------------------------------------
PresentationFramework.resources
    程序集版本:4.0.0.0
    Win32 版本:4.8.9032.0
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/PresentationFramework.resources/v4.0_4.0.0.0_zh-Hans_31bf3856ad364e35/PresentationFramework.resources.dll
----------------------------------------
System.Windows.Forms.resources
    程序集版本:4.0.0.0
    Win32 版本:4.8.9032.0 built by: NET481REL1
    基本代码:file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms.resources/v4.0_4.0.0.0_zh-Hans_b77a5c561934e089/System.Windows.Forms.resources.dll
----------------------------------------

************** JIT 调试 **************
要启用实时(JIT)调试,
该应用程序或计算机的 .config 文件(machine.config)的 system.windows.forms 节中必须设置
jitDebugging 值。
编译应用程序时还必须启用
调试。

例如:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

启用 JIT 调试后,任何未经处理的异常
都将被发送到在此计算机上注册的 JIT 调试程序,
而不是由此对话框处理。

关闭该模式,注册表值没有变动,就是说关闭不了感光模式始终为启用状态,除非改PhotosensitiveMode的数据为false 目前的情况是,有报错窗口但能用,只是这个功能软件关不了,只能改注册表

6get-xiaofan commented 1 year ago

此异常是由触摸键盘功能导致的,感光模式无法关闭问题将由下个版本修复,预计8月7日上线正式版,要解除这个异常报错,可以将KeyboardMode的值改为false即可在切换时不报错。

6get-xiaofan commented 1 year ago

请保持issue开启,修复后issue将用于定位,修复后自动关闭

Little-Data commented 1 year ago

另一个小问题:重启系统后软件自启动时会弹出系统UAC确认弹窗

6get-xiaofan commented 1 year ago

因为软件需要用到管理员权限,UAC用户账户控制可以在控制面板->用户账户->更改用户账户控制设置,中关闭UAC通知