如何恢复企业 Windows 7 主题
作为我圣诞节周的副项目,我想我应该创建一个可以从 Windows 启动文件夹运行的快速控制台应用程序。
该应用程序将删除一些不需要的全局企业桌面图标(我喜欢运行干净的桌面 - 这常见吗?)并将 Windows 7 主题重置为我可爱的 Visual Studio 2010 图形。
我已经阅读了为什么不应该为用户以语法方式完成此操作的原因,但我觉得这种情况有所不同,因为每天早上我都会手动删除图标并重置主题(政策并没有阻止这一点 - 只是每天早上重新应用它)所以我认为这个小项目从长远来看可以节省我的时间。
我正在删除图标,但我正在努力设置我的主题:
Dim key As RegistryKey = My.Computer.Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Themes", True)
key.SetValue("CurrentTheme", "C:\Users\myprofile\AppData\Local\Microsoft\Windows\Themes\VS2010.theme")
key.Close()
这是正确设置注册表项但不应用它。任何有关如何进行这项工作或替代方案的建议将不胜感激。最终我可能会尝试一个简单的壁纸集,但如果可能的话我想使用主题!
谢谢
As my Christmas week side-project I thought I'd knock up a quick console app that I can run from the windows Start-up folder.
The application is going to delete some unwanted Global Corporate Desktop Icons (I like to run a clean desktop - is this common?) and Reset the Windows 7 Theme to my lovely Visual Studio 2010 graphics.
I have read the reasons why this shouldn't be done pro grammatically for the user but I feel this case is different as every morning I am manually deleting the icons and resetting the theme (policy is not stopping this - just reapplying it every morning) so I though this little side project could save me time in the long term.
I am deleting the Icons OK but I am struggling to set my theme ala:
Dim key As RegistryKey = My.Computer.Registry.CurrentUser.OpenSubKey("Software\Microsoft\Windows\CurrentVersion\Themes", True)
key.SetValue("CurrentTheme", "C:\Users\myprofile\AppData\Local\Microsoft\Windows\Themes\VS2010.theme")
key.Close()
This is setting the registry key correctly but not applying it. Any suggestions as to how to make this work or alternatives would be appreciated. Ultimately I may try a simple Wallpaper Set but I would like to use the theme if possible!
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须通过 P/Invoke 来进行更改。您需要使用
SetSystemVisualStyle
方法。PInvoke.net 现在给我带来了问题,因此您可能需要使用 缓存页面。
You'll have to P/Invoke to make that change. You'll need to use the
SetSystemVisualStyle
method.PInvoke.net is giving me problems right now so you might need to used the cached page.