|
本帖最后由 tars-chiu 于 2020-2-18 17:50 编辑
slore大
我的问题解决了,谢谢点拨
修改shell_helper.lua就可以实现
- require 'reg_helper'
- System = {}
- local regkey_colortheme = [[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize]]
- local regkey_darktheme = [[HKEY_CURRENT_USER\Software\Microsoft\Windows\DWM]]
- function System:GetSetting(key)
- if key == 'AppsColorTheme' then
- return (reg_read(regkey_colortheme, 'AppsUseLightTheme') or 1) | 0 -- convert to integer
- end
- return 0
- end
- function System:ColorTheme(mode)
- if mode == 'light' then
- reg_write(regkey_colortheme, 'AppsUseLightTheme', 1, winapi.REG_DWORD)
- reg_write(regkey_darktheme, 'ColorPrevalence', 0, winapi.REG_DWORD)
- else
- reg_write(regkey_colortheme, 'AppsUseLightTheme', 0, winapi.REG_DWORD)
- reg_write(regkey_darktheme, 'ColorPrevalence', 1, winapi.REG_DWORD)
- end
- app:call('System::ChangeColorThemeNotify')
- end<img src="C:\Users\20591\Desktop\1.gif" border="0" alt="">
复制代码 |
|