一  : 解析问题

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. SQL Server 脚本语句

    一.语法结构 select select_list [ into new_table ] from table_source [ where search_condition ] [ group by ...

  2. php session_id()函数介绍及代码实例

    session_id()功能: 获取设置当前回话ID. 函数说明: string session_id ([ string $id ] ) 参数: 如果指定了参数$id,那么函数会替换当前的回话id. ...

  3. cognos 10.2.2 搭建网关做负载均衡

    最近要设计cognos服务器灾备模式,所以想到了cognos10自带的gateway负载均衡模式,搭建起来还是挺简洁的 设计背景: cognos主服务器:231 cognos灾备服务器:238 gat ...

  4. PHP pear安装出现 Warning: require_once(Structures/Graph.php)...错误

    今天在WINDOWS安装pear,一路无阻很顺利安装完成,接着想安装下pear email包来玩下,但接下来却报: Warning: require_once(Structures/Graph.php ...

  5. caffe源码阅读(3)-Datalayer

    DataLayer是把数据从文件导入到网络的层,从网络定义prototxt文件可以看一下数据层定义 layer { name: "data" type: "Data&qu ...

  6. ilasm.exe与ildasm.exe的使用(编译与反编译)

    ilasm.exe与ildasm.exe的使用(编译与反编译)   首先打开cmd命令.cd 到 C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0 ...

  7. 简单的doc命令

    cd 切换目录 dir 显示目录列表 mkdir 创建目录(mkdir) rmdir 删除空目录(rmdir test) rmdir  /s 删除非空目录(rmdir test /s) echo 创建 ...

  8. React组件三

    <script> <!-- getDefalutPros 设置组件的默认值--> <!--var Mytitle=React.createClass({ getDefau ...

  9. div 被Object盖住的。解决办法

    今天遇到一个比较头疼的问题,就是在一个标签上右键,弹出的菜单div被标签内的Office控件Object挡住了下半部分,始终无法显示.查了好多解决方案,最终都不能解决问题,几乎都要放弃了.中午吃饭的时 ...

  10. c#指针用法示例。

    using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.I ...