Hack 28 Customize Folder Icons and Balloon Text


Make it easier to recognize specific folders and remember their contents, by giving them their own pictures and identifying text.

All folders are not created equal; some are more important than others. Folders I use for writing books and articles, or for storing digital music, for example, are more vital to me than folders that hold tax records from eight years ago.

So I like to give myself visual clues when browsing my computer about what each folder holds and how important it is to me. I have so many folders on my hard disk that I can't always immediately recall the purposes of some of them, so for some I also create balloon text that describes the purpose of the folder when I hover my mouse over the folder.

To force a folder to display a specific icon and to have it display balloon text when you hover your mouse over it, create a Desktop.ini file in that folder. That file contains instructions on which icon to use and balloon text to display.

If you don't want to display customized balloon text, you can display an icon for any folder without having to create a Desktop.ini file yourself. Right-click on the folder you want to customize, choose Properties Customize "Change icon" and browse to the icon you want to use. When you do that, you'll automatically create a Desktop.ini file that will display the proper icon.

Before creating the file, choose the icon you want to use for the folder. Icons end in an .ico extension. You can also use .bmp bitmap files as icons. Make sure to note the name of the icon or bitmap, including its full path. If you want, create your own icon [Hack #19].

Not all icons are in .ico files, however. Many are part of entire icon libraries in .dll files. For example, you'll find hundreds of icons in the shell32.dll file found in C:\WINDOWS\System32 folder. Each icon in a .dll file is assigned an index number, starting with 0. To use icons in .dll files, you'll need to know the index number for the specific icon. You won't be able to find out the index number by examining the file manually; instead, you'll need third-party software. Resource Tuner (http://www.heaventools.com) lets you examine the resources of any file and, among other things, will let you browse through the file's icons and show you their index numbers. It's shareware and free to try, but it costs $34.95 if you keep using it.

Figure 3-18 shows Resource Tuner, looking inside Shell32.dll and listing the index number for an icon.

Figure 3-18. Using Resource Tuner to find the index number of an icon

For my Music folder, I'm going to use a .bmp file of cover art of the mezzo-soprano Cecilia Bartoli.

Now it's time to create the Desktop.ini file. Using a text editor like Notepad, create it in the folder you want to customize. I'm going to customize my C:\Music folder, so that's where I create it. Here's what my file looks like:

InfoTip=The Best of Puccini, Donizetti, Verdi, and the Rest

The heading, [.ShellClassInfo], is required, so make sure to put that at the top of the file. The IconFile= entry should point to the file you want to use as an icon?and again, it can be an .ico file, a .bmp file, or an icon found in an icon collection, such as in a .dll file. Make sure to include the file's full path. The IconIndex= entry should point to the index number of the icon if the file is in an icon collection. If it's not in an icon collection, use the number 0. The InfoTip= entry should point to the text you want displayed as balloon text.

After you create the Desktop.ini file, you need to define the folder you want to customize as a system folder, in order for it to be able to display the icon and balloon text. At the command prompt, issue the command attrib +s foldername, where foldername is the name of the folder you're customizing.

You're now done; the icon and balloon text should display. Figure 3-19 shows what mine looks like.

Figure 3-19. My Music folder with an icon and balloon text