一  : 解析问题

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: 写代码

  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using System.IO;
  10. using System.Threading;
  11. using System.Diagnostics;
  12. namespace win7改变主题
  13. {
  14. public partial class Form1 : Form
  15. {
  16. public Form1()
  17. {
  18. InitializeComponent();
  19. string sPath = Environment.GetEnvironmentVariable("windir");//获取系统变量 windir(windows)
  20. DirectoryInfo directoryInfo = new DirectoryInfo(sPath + @"\Resources\Themes\");
  21. foreach (FileInfo i in directoryInfo.GetFiles("*.theme"))
  22. {
  23. comboBox1.Items.Add(i.FullName);
  24. }
  25. }
  26. private void button1_Click(object sender, EventArgs e)
  27. {
  28. if (comboBox1.SelectedIndex == -1)
  29. {
  30. return;
  31. }
  32. string sFile = comboBox1.SelectedItem.ToString();
  33. string sCmd = string.Format(@"
  34. rundll32.exe %SystemRoot%\system32\shell32.dll,Control_RunDLL %SystemRoot%\system32\desk.cpl desk,@Themes /Action:OpenTheme /file:""{0}""", sFile); //cmd命令
  35. Process cmd = new Process();
  36. cmd.StartInfo.FileName = "cmd";
  37. cmd.StartInfo.RedirectStandardInput = true;
  38. cmd.StartInfo.RedirectStandardOutput = true;
  39. cmd.StartInfo.CreateNoWindow = true;
  40. cmd.StartInfo.UseShellExecute = false;
  41. cmd.Start();
  42. cmd.StandardInput.WriteLine(sCmd);
  43. cmd.StandardInput.Flush();
  44. cmd.StandardInput.Close();
  45. cmd.Close();
  46. cmd.Dispose();
  47. }
  48. }
  49. }

二 执行程序  如图:

三 : 程序源代码 下载:

http://download.csdn.net/detail/qq283868910/3866000

编程实现改变win7主题的更多相关文章

  1. Win7主题被禁用

    今天早上干了一件傻缺的事,打开电脑的时候,某卫士提醒开机速度击败全国0.2%的电脑,之后点了优化...随后就发生了接下来的一幕: win7下面的主题都不能使用了,只能使用那种复古(很丑的样式,看着很不 ...

  2. Windows Server 2008 R2 开启Win7主题效果Aero

    1.打开 开始---管理工具----服务器管理器--功能 2.点击 “添加功能”,选择“桌面体验”,这样就会安装上win7 主题和Windows media player 3.重启电脑后,在“服务”里 ...

  3. c/c++ 网络编程 UDP 改变网关和网卡名字

    网络编程 UDP 改变网关和网卡名字 在程序里动态改变网关和网卡名字 1,改变网卡名字 #include <stdio.h> #include <string.h> #incl ...

  4. c/c++ 网络编程 UDP 改变网卡的硬件地址

    网络编程 UDP 改变网卡的硬件地址 在程序里动态改变网卡的硬件地址 1,取得网卡的硬件地址 #include <stdio.h> #include <string.h> #i ...

  5. c/c++ 网络编程 UDP 改变IP地址

    网络编程 UDP 改变IP地址 在程序里动态改变主机的IP地址 1,改变ipv4的地址 #include <stdio.h> #include <string.h> #incl ...

  6. Windows Server 2008 R2英文版修改桌面主题(Win7主题)

    1:首先打开Server Manager(凡是不知道在那里开发均可像Win7一样在运行里面搜索) 2:然后在左边的树形菜单中选择:Feature 点击右边页面中的:Add Features 这时候会出 ...

  7. IDEA的使用方法(三)(改变字体主题)

    今天正式写代码的时候发现,一开始由于破解的太随意,没有设定好主题和字体现在看的有点昏,那么接下来就发一个该如何改变IDEA的字体和主题的教程: File——>setting——>Edito ...

  8. vue使用改变element-ui主题色

    每个项目的主题色一般都不一样,直接用element-ui的默认主题色似乎有点不合适,还需要自己一个一个的找元素class名然后在修改样式,非常麻烦,还容易影响到包含该类名的其他元素样式,所以需要自定义 ...

  9. Win7主题存放路径详解

    WIN7用户主题--- 自定义主题  首先当然是用户自定义的主题文件夹,这个文件夹一般是存放在下面这个路径(注意那个用户名改成你自己的登陆名喔,比如 administrator) C:\Users\用 ...

随机推荐

  1. [02] Oracle简单单行函数(字符+数值+日期+转换+通用)

    1. 字符函数 --upper(str), lower(str):将str转换成大,小写 select upper('hello') as x1, lower('HELlo') as x2 from ...

  2. linux 学习一

    linux 命令 ls -al ls -l cal

  3. UVA 11729 - Commando War(贪心 相邻交换法)

    Commando War There is a war and it doesn't look very promising for your country. Now it's time to ac ...

  4. 现代密码学应用的范例-PGP

    PGP(Pretty Good Privacy),是一个基于RSA公钥加密体系的邮件加密软件. 产生背景: 电子邮件在传输中使用SMTP协议存在这样的问题 1.无法保证邮件在传输过程中不被人偷看 2. ...

  5. js 作为属性的变量

    当声明一个javascript全局变量时,实际上是定义了全局对象的一个属性. 当使用var声明一个变量时,创建的这个属性是不可配置的,也就是说这个变量无法通过delete运算符来删除.可能你已经注意到 ...

  6. html渐隐轮播

    这是我之前用的时候从一个模板中下载下来用的,现在又用到了,我又重新找了一遍,为防止我下次用到忘记,特写下此文: 下载插件:jquery-2.1.4.min.js和slider.js 首页轮播页面首页i ...

  7. win7如何完全写在iis

    在前些天,因为需要搭建了ftp服务器,但是今天不需要了,所以要卸载iis,因为我不会让iis和apache同时共存,所以只能卸载了 先找到windows功能,然后把Internet信息服务勾选掉,重启 ...

  8. HTML 页面加载动画效果

    浏览器:Chrome, IE <!doctype html> <html> <head> <title>CSS transform: CSS only ...

  9. IOS 多线程之GCD

    参考:http://www.cnblogs.com/wendingding/p/3806821.html <<Objective-C基础教程>> 第二版 一 简介 GCD 全称 ...

  10. POJ 1416 Shredding Company

    题目: http://poj.org/problem?id=1416 又16ms 1A了,这人品... #include <stdio.h> #include <string.h&g ...