编程实现改变win7主题
一 : 解析问题
1. Windows 7 主题在:%windir%\Resources\Themes :

2: 我们通过shell 命令 (这个是msdn中提到的)
rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:" %SystemRoot%\Resources\Themes\architecture.theme"
3: 写代码
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Data;
- using System.Drawing;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using System.IO;
- using System.Threading;
- using System.Diagnostics;
- namespace win7改变主题
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- string sPath = Environment.GetEnvironmentVariable("windir");//获取系统变量 windir(windows)
- DirectoryInfo directoryInfo = new DirectoryInfo(sPath + @"\Resources\Themes\");
- foreach (FileInfo i in directoryInfo.GetFiles("*.theme"))
- {
- comboBox1.Items.Add(i.FullName);
- }
- }
- private void button1_Click(object sender, EventArgs e)
- {
- if (comboBox1.SelectedIndex == -1)
- {
- return;
- }
- string sFile = comboBox1.SelectedItem.ToString();
- string sCmd = string.Format(@"
- rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:""{0}""", sFile); //cmd命令
- Process cmd = new Process();
- cmd.StartInfo.FileName = "cmd";
- cmd.StartInfo.RedirectStandardInput = true;
- cmd.StartInfo.RedirectStandardOutput = true;
- cmd.StartInfo.CreateNoWindow = true;
- cmd.StartInfo.UseShellExecute = false;
- cmd.Start();
- cmd.StandardInput.WriteLine(sCmd);
- cmd.StandardInput.Flush();
- cmd.StandardInput.Close();
- cmd.Close();
- cmd.Dispose();
- }
- }
- }
二 执行程序 如图:

三 : 程序源代码 下载:
http://download.csdn.net/detail/qq283868910/3866000
编程实现改变win7主题的更多相关文章
- Win7主题被禁用
今天早上干了一件傻缺的事,打开电脑的时候,某卫士提醒开机速度击败全国0.2%的电脑,之后点了优化...随后就发生了接下来的一幕: win7下面的主题都不能使用了,只能使用那种复古(很丑的样式,看着很不 ...
- Windows Server 2008 R2 开启Win7主题效果Aero
1.打开 开始---管理工具----服务器管理器--功能 2.点击 “添加功能”,选择“桌面体验”,这样就会安装上win7 主题和Windows media player 3.重启电脑后,在“服务”里 ...
- c/c++ 网络编程 UDP 改变网关和网卡名字
网络编程 UDP 改变网关和网卡名字 在程序里动态改变网关和网卡名字 1,改变网卡名字 #include <stdio.h> #include <string.h> #incl ...
- c/c++ 网络编程 UDP 改变网卡的硬件地址
网络编程 UDP 改变网卡的硬件地址 在程序里动态改变网卡的硬件地址 1,取得网卡的硬件地址 #include <stdio.h> #include <string.h> #i ...
- c/c++ 网络编程 UDP 改变IP地址
网络编程 UDP 改变IP地址 在程序里动态改变主机的IP地址 1,改变ipv4的地址 #include <stdio.h> #include <string.h> #incl ...
- Windows Server 2008 R2英文版修改桌面主题(Win7主题)
1:首先打开Server Manager(凡是不知道在那里开发均可像Win7一样在运行里面搜索) 2:然后在左边的树形菜单中选择:Feature 点击右边页面中的:Add Features 这时候会出 ...
- IDEA的使用方法(三)(改变字体主题)
今天正式写代码的时候发现,一开始由于破解的太随意,没有设定好主题和字体现在看的有点昏,那么接下来就发一个该如何改变IDEA的字体和主题的教程: File——>setting——>Edito ...
- vue使用改变element-ui主题色
每个项目的主题色一般都不一样,直接用element-ui的默认主题色似乎有点不合适,还需要自己一个一个的找元素class名然后在修改样式,非常麻烦,还容易影响到包含该类名的其他元素样式,所以需要自定义 ...
- Win7主题存放路径详解
WIN7用户主题--- 自定义主题 首先当然是用户自定义的主题文件夹,这个文件夹一般是存放在下面这个路径(注意那个用户名改成你自己的登陆名喔,比如 administrator) C:\Users\用 ...
随机推荐
- Android中使用shape实现EditText圆角
之前看到手机上的百度editText控件是圆角的就尝试做了一下,看了看相关的文章. 因为代码少,看看就知道了.所以下面我就直接贴上代码供大家参考,有其他的好方法记得分享哦~ 整个代码不涉及JAVA代码 ...
- UIImageView的图片拉伸
iOS 8:UIView Stretching设置 使用小图片当变长输入框或类似QQ聊天文字背景效果时,需要拉伸图片.UIImage提供了三个可完成此任务的方法: resizableImageWith ...
- html-----012---颜色的改变
颜色由红色.绿色.蓝色混合而成. 颜色值 颜色由一个十六进制符号来定义,这个符号由红色.绿色和蓝色的值组成(RGB). 每种颜色的最小值是0(十六进制:#00).最大值是255(十六进制:#FF). ...
- WPF简单拖拽功能实现
1.拖放操作有两个方面:源和目标. 2.拖放操作通过以下三个步骤进行: ①用户单击元素,并保持鼠标键为按下状态,启动拖放操作. ②用户将鼠标移到其它元素上.如果该元素可接受正在拖动的内容的类型,鼠标指 ...
- mongodb write 【摘自网上,只为记录,学习】
mongodb有一个write concern的设置,作用是保障write operation的可靠性.一般是在client driver里设置的,和db.getLastError()方法关系很大 一 ...
- (poj) 1751 Highways
Description The island nation of Flatopia is perfectly flat. Unfortunately, Flatopia has a very poor ...
- 利用反射生成SQL语句
// 修改学员信息的方法 public bool ModifyStudent(MODEL.Students model) { // 利用反映获取类对所有属性,用来动态生成SQL语句 StringBui ...
- ubuntu下编译安装apache
官网http://httpd.apache.org/download.cgi下载apache源码包后 /*解包*/ gzip -d httpd-2_x_NN.tar.gz tar -xf httpd- ...
- iframe 的基本操作
要在服务器环境下才行 1.iframe 下操作父页面window.parent.document.getElementById //全部支持window.top //最顶层ie 下的iframe的on ...
- MIS框架开发计划
计划开发模块 缓存模块 全球化模块(时间转换.货币转换.语言切换.度量转换.时区转换) 用户模块 用户短消息模块 日志模块(系统日志.用户操作日志.安全审计日志) 权限模块 配置模块 事件模块(观察者 ...