Programming changes the win7 theme, programming implements the win7 theme

Source: Internet
Author: User

Programming changes the win7 theme, programming implements the win7 theme

I. Resolution

1. Windows 7 theme: % windir % \ Resources \ Themes:

 

 

 

2: We use the shell command (this is mentioned in msdn)

Rundll32.exe % SystemRoot % \ system32 \ shell32.dll, Control_RunDLL % SystemRoot % \ system32 \ desk. cpl desk, @ Themes/Action: OpenTheme/file: "% SystemRoot % \ Resources \ Themes \ architecture. theme"

 

3: write code

[Csharp]View plaincopy
  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 changed theme
  13. {
  14. Public partial class Form1: Form
  15. {
  16. Public Form1 ()
  17. {
  18. InitializeComponent ();
  19. String sPath = Environment. GetEnvironmentVariable ("windir"); // obtain the system variable 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 button#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 command
  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. }

 

2. Execution program:

 

 

 

3. Download the program source code:

 

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


How does win7 change themes?

Hello, you can right-click and select the pop-up dialog box in the personalized bar. You can set the theme based on your preferences. However, the theme that comes with the system is generally not recommended. download from the zone. If you need to send me your email address, you can send me a few for you. If you agree, please accept the answer. Thank you.

How can I change the background of my computer in WIN7?

Are you talking about the background of folders?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.