SEARCH

How-To Geek

Create a Windows 7 Theme Pack From Scratch

Windows customization isn’t anything new, but with Windows 7, customization got a lot easier with theme packs. Here is how you can create your own theme pack from scratch.

Creating a theme pack from scratch is a lot more work than using built in tools, but it gives you a lot more flexibility by allowing you to creating brand icons, RSS background feeds, and customizing every feature which may not be easy to do through Windows native tools. When you are going to create a theme that you can share with others you will want to take into account what exactly you will be able to change that others will be able to use. Windows 7 theme packs allow you to customize the desktop background (including “slide show” backgrounds, and RSS feed backgrounds), screen saver, system sounds, desktop icons, mouse pointers, and system colors.

Customize your theme

Start the theme pack by gathering all the files you want to use for your customization. Remember to get items for every part you are going to customize. If you do not specify parts to theme, the system will use the defaults that come with windows. So if you don’t find a mouse cursor you like, Windows will use the default cursor for the system. Once you have the files you want, put them all in a folder that you can easily get to. I am going to be building a theme based on the Matrix wallpapers we posted recently.

We will start the customization by generating the .theme file. This file is the heart of your theme pack and will tell Windows which media file to use where. The .theme file is really just a specially formatted text file so start by right clicking in your folder and creating a new text document. Name the file whatever you want and open it with your favorite text editor.

The .theme file is going to be broken up into sections. The first section is the [Theme] section. The [Theme] section only has two options, the theme display name, and the theme icon. The display name can be whatever you want the theme to be called in the control panel > personalize window, and the icon graphic must be a PNG file. The graphic will be scaled to 80×240 so use something close to that resolution or ratio.

Note: The theme icon will only show up under the Control Panel > Personalization window so don’t worry if you don’t see the icon.

The rest of the [Theme] section will tell windows which icons to use for the desktop icons (Computer, Documents, Recycle Bin, Network). For icon files you can use either standalone .ico files, or you can use icons embedded in .exe or .dll files also. For .exe and .dll files you need to specify which icon to use with a comma and then say which icon you are going to use. (my.exe,0 or my.dll,-50). Each desktop item has a unique screen that identifies it so make sure you use the right string for each item.

Computer = [CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\DefaultIcon]
Documents = [CLSID\{59031A47-3F72-44A7-89C5-5595FE6B30EE}\DefaultIcon]
Network = [CLSID\{F02C1A0D-BE21-4350-88B0-7367FC96EF3C}\DefaultIcon]
Recycle Bin = [CLSID\{645FF040-5081-101B-9F08-00AA002F954E}\DefaultIcon

Below each item you will specify the icon with DefaultValue except the Recycle Bin which will use values Full and Empty.

After the [Theme] section is the optional [Control Panel\Colors] and [Control Panel\Cursors] sections. The colors section would be extremely hard to adjust manually but if you really want to try it you can adjust the following items using RGB codes.

Note: RGB codes range from 0-255 and are separated by spaces. So black is 0 0 0 and white is 255 255 255.

ActiveTitle, Background, Hilight, HilightText, TitleText, Window, WindowText, Scrollbar, InactiveTitle, Menu, WindowFrame, MenuText, ActiveBorder, InactiveBorder, AppWorkspace, ButtonFace, ButtonShadow, GrayText, ButtonText, InactiveTitleText, ButtonHilight, ButtonDkShadow, ButtonLight, InfoText, InfoWindow, GradientActiveTitle,
GradientInactiveTitle

Instead of doing this section by hand you could also adjust the colors using the control panel > personalize > colors, and then save the theme file and then just copy and paste the colors section into the theme you want.

The [Control Panel\Cursors] section has an option for which .cur or .ani files you want to use for each cursor. The valid cursors you can replace are the following:

Arrow, Help, AppStarting, Wait, NWPen, No, Size, SizeWE, Crosshair, IBeam, SizeNWSE, SizeNESW, SizeAll, UpArrow

If not cursor is defined the system defaults will be used.

After these two sections comes the first mandatory section and that is the [Control Panel\Desktop] section. If you do not have this part of the file the theme will not be recognized as a valid theme. In here you will specify what the wallpaper image will be, how the image will be displayed and if the image is tiled or not. The three values you need are Wallpaper, TileWallpaper, and WallpaperStyle.

Wallpaper can be a .bmp, .gif, .jpg, .png, or .tif file. TileWallpaper is either a 1 or 0; 1 indicates the wallpaper should be tiled while 0 disables the tile. WallpaperStyle can be the following values. 0 means the image is centered, 2 means the image is stretched, 6 will fit the image to the screen, or 10 will will resize and crop the image to fit the screen.

After you have the [Control Panel\Desktop] section defined you can move on to the next optional section [Slideshow]. [Slideshow] is how you can make rotating backgrounds for Windows 7. This section has the following attributes: Interval, Shuffle, RSSFeed, ImagesRootPath, Item*Path (* represents which pictures will be included in the slide show). The attributes can be defined with the following values: Interval shows the amount of time to wait before changing the wallpaper image (in milliseconds), Shuffle is a 1 or 0 to determine if images are displayed in alphabetical order or shuffled, RSSFeed points to the URL of the images RSS feed you want to use, ImagesRootPath is the folder containing your images, and Item*Path determines how many items are included in the slideshow. Each Item*Path entry points to one wallpaper image so you need to specify each image manually.

Note: ImagesRootPath and RSSFeed cannot be used together.

Following [SlideShow] is another optional section called [Metrics]. [Metrics] section shows dimensions of various display elements, such as the window border width, icon height, or scrollbar width. The NonclientMetrics and IconMetrics values are binary structures defined by NONCLIENTMETRICS and ICONMETRICS in winuser.h. In other words, you probably don’t want to edit this section by hand. If you are going to change the value of any window boarders I would suggest doing that through the control panel and saving the modified theme. Then export the [Metrics] section into your desired theme. Non-the-less, here is an example of a [Metrics] section.

Next is the required [VisualStyles] section. This section allows you to point to a .msstyles file that can be modified for customization. If you use a .msstyles value in this section you will need to remove the [Metrics] and [Color] sections of your theme because the .msstyles will replace both of those sections.  The valid attributes are Path, Color, Composition, Size, ColorizationColor, and Transparancy. These options makes it easier to customize an already existing theme. For example, if you set the path attribute to %SystemRoot%\resources\Themes\Aero\Aero.msstyles you can easily begin customizing the default Windows Aero theme.

Following [VisualStyles] is the optional [Sounds] and [AppEvents] sections. For this section you can either specify each sound manually by using the path to a .wav file like so:
[AppEvents\Schemes\Apps\.Default\SystemExclamation]
DefaultValue=

Or you can specify one of the built in sound schemes with
SchemeName=
You can use one of the built in sound schemes or specify the .dll file containing the theme.

Following [Sounds] is the [Boot] section. The [Boot] section only has one value for SCRNSAVE.EXE point this value to whatever .scr file you want to use for your screensaver.

Finally is the required [MasterThemeSelector] which only has one attribute and you don’t have a choice for the value. The only thing that goes in this section is MTSM=DABJDKT which indicates that the theme is valid.

Once you have all of the required and optional sections in the file, save the file to whatever you want to call it and change the extension from .txt to .theme. Make sure you are viewing known file extensions when changing the extension otherwise the true extension will be hidden.

Packaging your theme pack

The final step it to package all of your media into a .themepack file. The .themepack file is simply a .cab file with an extension change. So if you already have software that can create a .cab file, simply use that software to compress your theme folder with all of your media in it and change the extension. If you don’t already have a cab packing program you can check out CabPack which is freeware.

Here’s an example of the Matrix Theme we built from scratch.

sshot-2010-08-11-[15-42-35]

Conclusion

Once you have your theme pack you can apply it to your own system before sharing it. If there is anything else that needs tweaking you can either go back and change it in your .theme file your you can change it through the Windows GUI and then re-save the theme for sharing. Now go out there and share your favorite theme tweaks with the rest of the world.

Links

Microsoft theme pack reference
CabPack

Justin is a Linux and HTPC enthusiast who loves to try new projects. He isn't scared of bricking a cell phone in the name of freedom.

  • Published 08/12/10

Comments (12)

  1. at0mic

    i followed everything up to the sound. i have some pink floyd sounds in a file. do i put the individual sound file after “DEFAULTVALUE=” ???

  2. Justin Garrison

    Yes you put the sounds after defaultvalue= just like the icons section. The sound files can only be .wav format. For example you can set a sound with defaultvalue=sounds\error.wav
    I hope that works for you.

  3. at0mic

    oh geesh, that helps now, they were mp3. i didn’t even notice that. thanks…

  4. rid

    After complet all the setting, i just use winzip fpr all. And then change the .zip to .themepack ~ Its works, or you can do the other ways to open any .themepack to . zip to get all the archive ~

  5. Mick

    Quote “you could also adjust the colors using the control panel > personalize > colors, and then save the theme file and then just copy and paste the colors section”… where does one find the file in order to copy the section from it? I’ve looked all over the place but can’t find any editable/openable(?) files that i can copy it from.

  6. Selden

    Justin,

    Thanks a lot for making this information available!

    Do you know how one would include login background images?

    Several themepacks I’ve seeen have included this feature.
    e.g. the one that Dell ships with their Latitude laptop computers,
    and at least one of the themepacks that I downloaded from Microsoft.

  7. Andytizer

    Hi there, I am interested in creating a theme that is exactly the same as default Win7 Aero, but allows for a window border size of 0. Do you know if this is possible?

  8. TechGeek01

    I saved as a .themepack, but how do I apply it? It won’t open, and I don’t know where to put it manually to get it to work. I’ve also tried .theme, but it then says ‘Windows can’t apply the theme.’ Please help!

  9. rebakan

    I have Acer Aspire PC with Windows 7 Home Premium. I want to make Aero Themes, but including only two or three wallpapers, without changing anything more.Is it possible? Also, I downloaded some free Aero Themes from Internet, put on C:Windows\Resources\Themes, but my pc only opens the ones I got from Microsoft.Do you know why?Sorry to be so long with so many questions,I am a novice in Pcwork.I do thank you in advance.

  10. rebakan

    Excuse me again, could it be possible to have a Aero Theme as model like the one made by Windows 7, so I would change only the wallpapers to the ones I most like it and save this file with another name? I’m not sure if I was clear enough what I want, once I’m not American, English is my second language.Thanks in advance.

  11. Morry

    I put the .theme file in \windows\resources\themes but then when I go to personalize
    it doesn’t appear as an option what am I doing wrong I want it to be in the .wim file I’m creating for deployment.

  12. Avatar

    I had the same problem that TechGeek01 had. What is the solution?

Get Free Articles in Your Inbox!

Join 134,000 newsletter readers

Email:

Go check your email!