Windows 98 Unleashed

Contents


- 13 -
A Few Good Hacks: Some Useful Registry Tweaks


A little knowledge that acts is worth infinitely more than much knowledge that is idle. --Kahlil Gibran An old Scottish proverb says that "fine words butter no parsnips." Chapter 12, "Getting to Know the Windows 98 Registry," presented plenty of fine words (if that's not too immodest a thing to say) about the Registry and how you work with it, but now it's time to butter a Registry parsnip or two. In other words, you're well versed in the theory of the Registry, so now you need to get up to speed with the practice. What kinds of things can you do with the Registry? In particular, what kinds of things can you do with the Registry that can't be done via the Control Panel, Explorer, or any of the applets? That's what this chapter is all about. I'll show you a fistful of practical Registry techniques that lets you customize Windows 98 in undreamed-of ways.

Working with File Types and Applications

You begin your look at Registry tricks by examining a few techniques that will give you more control over file types and applications.

Customizing the New Menu

In Chapter 14, "File and Folder Tricks and Techniques," I show you how to create new file types and modify existing ones. One of Windows 98's handiest features is the New menu, which lets you create a new file without working within an application. In Explorer, just select File |ew, or right-click inside the Contents pane and select New, to display the menu shown in Figure 13.1. From there, just select a command to create a new instance of that particular file type.

FIGURE 13.1. The New menu lets you create new documents without opening an application.

You'll see in Chapter 14 that Windows 98 recognizes more than 100 file types, but the New menu lists only seven by default (installed applications may add more). What mechanism determines whether a file type appears on the New menu? The Registry, of course. Start the Registry Editor and open the HKEY_CLASSES_ROOT key. As I mentioned in Chapter 12, the first 150 or so subkeys of HKEY_CLASSES_ROOT are the file extensions that Windows 98 recognizes. Most of these keys contain only a Default setting that takes on either of the following values:

A few of these extension keys, however, also have subkeys. For example, open the .bmp key and you see that it has a subkey named ShellNew, as shown in Figure 13.2. This subkey is what determines whether a file type appears on the New menu. Specifically, if the extension is registered with Windows 98 and it has a ShellNew subkey, the New menu sprouts a command for the associated file type.

FIGURE 13.2. The ShellNew subkey controls whether a file type appears on the New menu.

The ShellNew subkey always contains a setting that determines how Windows 98 creates the new file. Four settings are possible:

NullFile: This setting, the value of which is always set to a null string (""), tells Windows 98 to create an empty file of the associated type. Of the six file types (excluding Folder and Shortcut) that appear on the New menu, three use the NullFile setting: Text Document (.txt), Bitmap Image (.bmp, see Figure 13.2), and Wave Sound (.wav).

FileName: This setting tells Windows 98 to create the new file by making a copy of another file. Windows 98 has a special folder to hold these "template" files. This folder, called ShellNew, is hidden, so you must activate Explorer's Show all files option to view it, as shown in Figure 13.3. On the New menu, only the WordPad Document (.doc) file type uses the FileName setting, and its value is winword.doc. (Recall that the default file type for WordPad is a Word for Windows 6 document.) To see this value, you need to open the following key:

HKEY_CLASSES_ROOT\.doc\Wordpad.Document.1\ShellNew

FIGURE 13.3. The ShellNew folder holds templates used by the New menu to create new documents.


ABOUT ShellNew AND THE FileName SETTING
Here are a few notes about the ShellNew key's FileName setting:

Chapter Although the ShellNew menu contains quite a few templates, only the WordPad documents are registered with Windows 98. In other words, the Registry does have a key for .xls (Excel), for example, in HKEY_CLASSES_ROOT, and this key has a ShellNew subkey with a FileName setting that points to Excel.xls; but XLS files aren't registered with Windows 98.

Chapter The FileName setting doesn't have to point to a file in the ShellNew folder. It can point to a file in any folder as long as you include the file's full pathname.

Chapter If you check out the .doc key in HKEY_CLASSES_ROOT, you note that it has three subkeys--Word.Document.6, WordDocument, and Wordpad.Document.1--and each has a ShellNew subkey. Why isn't there a New menu command for each document type? Because Windows 98 sets up a New menu command only for registered file types (Wordpad.Document.1, in this case).


Command:
This setting tells Windows 98 to create the new file by executing a specific command. This command usually invokes an executable file with a few parameters. The New menu's Briefcase item uses this setting. If you check the ShellNew subkey for .bfc in HKEY_CLASSES_ROOT, you see the following value for the Command setting:

C:\windows\rundll32.exe syncui.dll,Briefcase_Create %1!d! %2

Data: This setting contains a binary value, and when Windows 98 creates the new file, it copies this binary value into the file.

Adding File Types to the New Menu

To make the New menu even more convenient, you can add new file types for documents you work with regularly. For any file type that's registered with Windows 98, you follow a simple three-step process:

1. Add a ShellNew subkey to the appropriate extension key in HKEY_CLASSES_ROOT.

2. Add one of the four settings discussed in the preceding list (NullFile, FileName, Command, or Data).

3. Enter a value for the setting.

In most cases, the easiest way to go is to use NullFile to create an empty file. The FileName setting, however, can be quite powerful because you can set up a template file containing text and other data.

Using Multiple New Menu Commands for a Single Application

For a given extension, Windows 98 lets you have only one New menu command. But what if you want to use the same application to create multiple kinds of new documents? For example, you might have a WordPad file that you use as a template (such as a daily to-do list). It would be nice to be able to create new WordPad documents that either are empty or use this template.

To accomplish this task, you need to set up a new, registered file type for the template, complete with its own extension, and set up a ShellNew key for this new type. Here are the basic steps to follow:

1. Use Explorer's View | Folder Options command to create a new file type that's associated with the application (see Chapter 14 for details). For a to-do list, you could create a TDL extension associated with WordPad.

2. Copy the template file into the ShellNew folder and rename it so that it has the extension you just registered. For example, if your WordPad file is named TODOLIST.DOC, rename it TODOLIST.TDL.

3. In the Registry Editor, find the new extension in HKEY_CLASSES_ROOT and add the ShellNew subkey.

4. Add the FileName setting and use the name of the template file in ShellNew.

Deleting File Types from the New Menu

Many Windows 98 applications like to add their file types to the New menu. (Microsoft Office alone adds five commands to the New menu.) If you find that your New menu is getting overcrowded, you can delete some commands to keep things manageable.

To do this, you need to find the appropriate extension in the Registry and delete the ShellNew subkey.


DETERMINING THE CORRECT FILE EXTENSION
If you're not sure which extension is associated with the New menu command you want to delete, you could search the Registry all day looking for it. An easier way is to just use the command to create a new document in any Explorer folder and see the resulting extension. Remember, though, that to see extensions in Explorer you need to select View | Options and deactivate the Hide MS-DOS file extensions for file types that are registered check box.


A MORE CAUTIOUS APPROACH
Instead of permanently deleting a ShellNew subkey, you can tread a more cautious path by simply renaming the key (to, for example, ShellNewOld). This will still prevent Windows 98 from adding the item to the New menu, but it also means that you can restore the item just by restoring the original key name.

Creating Application-Specific Paths

When you install a 32-bit application, it uses the Registry to store the path to its executable file. This means that you can start any 32-bit application simply by entering the name of its executable file, either in the Run dialog box or at the prompt in a DOS session. You don't need to spell out the complete pathname. For example, the executable filename for Backup is Msbackup.exe, so you could type msbackup and press Enter to start it.

This pathless execution is handy, but in the following two situations it doesn't work:

16-bit applications: These older programs don't store the paths to their executables in the Registry.

Documents: As you'll learn in Chapter 14, you can double-click a document in Explorer, and Windows 98 starts the associated application and loads the document. However, you can't load a document just by typing its filename in the Run dialog box or at the DOS prompt (unless the document is in the current folder). To solve both these problems, you can add a path to an executable file (an application-specific path) or to a document (a document-specific path) into the Registry by hand.

In the Registry Editor, open the following key:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\App Paths

As you can see in Figure 13.4, the App Paths key has subkeys for each installed 32-bit application. Each of these subkeys has one or both of the following settings:

Default: This setting spells out the path to the application's executable file. All the App Paths subkeys have this setting.

Path: This setting specifies one or more folders that contain files needed by the application. An application first looks for its files in the same folder as its executable file. If it can't find what it needs there, it checks the folder or folders listed in the Path setting. Not all App Paths subkeys use this setting.

FIGURE 13.4. The App Paths key contains path information for all installed 32-bit applications.

To create an application-specific path, highlight the App Paths key, create a new subkey, and assign it the name of the application's executable file. For example, if the program's executable filename is OLDAPP.EXE, name the new subkey OLDAPP.EXE. For this new subkey, change the Default setting to the full pathname for the executable file.

Actually, you don't have to give the new App Paths subkey the name of the executable file. You can use any name you like as long as it ends with .EXE and doesn't conflict with the name of an existing subkey. Why does it have to end with .EXE? Unless you specify otherwise, Windows 98 assumes that anything you enter in the Run dialog box or at the DOS prompt ends with .EXE. So by ending the subkey with .EXE, you need to type only the subkey's primary name. For example, if you name your new subkey OLDAPP.EXE, you can run the program by typing oldapp.

You create document-specific paths the same way. (Note, however, that the document's file type must be registered with Windows 98.) In this case, though, the Default setting takes on the full pathname of the document. Again, if you want to load the document just by typing its primary name, make sure that the new App Paths subkey uses the .EXE extension. For example, you can see in Figure 13.5 that I've created a subkey called TODO.EXE that points to E:\Data\Documents\ToDoList.doc. To launch this document, I need only type todo in the Run dialog box or at the DOS prompt.

FIGURE 13.5. An example of a document-specific path.

Instead of creating a path for a specific document, you might prefer to set up a path that points to an entire folder of documents. For example, it's usually a good idea to create separate folders for your data files. This technique makes it easier to find your data files and to back them up. Suppose, for example, that you store all your WordPad documents in a folder named E:\Data\Documents. Ideally, you'd like to be able to launch any of the documents in this folder just by typing its name in the Run dialog box or at the DOS prompt.

No problem. In the App Paths key, highlight the subkey that corresponds to the application you use to work with the documents. Modify the Path setting (if it has one; if not, you need to create a Path setting) to include the full pathname of the folder that contains the documents. Be sure to end the pathname with a semicolon (;). For example, Figure 13.6 shows a Path setting added to the WORDPAD.EXE subkey that points to G:\Data\Documents.

FIGURE 13.6. You can add a path that points to a folder full of documents.

Associating Multiple Extensions with One Application

In Chapter 14 I'll show you how to register new file types with Windows 98. This lets you set up an association between an extension and an application. For example, to handle the README.1ST text files that come with some programs, you could associate the .1ST extension with Notepad. This creates a new 1ST file type.

The problem with this approach, however, is that it involves re-creating the wheel by having to set up certain actions--such as Open and Print--for the new file type. In the 1ST file type, for example, the actions you set up are identical to those that are already set up for the Text Document file type. It would be better if you could just augment an existing file type with a new extension, such as adding the .1ST extension to the existing Text Document file type.

You know this is possible because if you look through the list of file types (in Explorer, select View | Folder Options and activate the File Types tab), you see that several file types have multiple extensions. The Movie Clip file type, for example, has several extensions, including .MPEG and .MPG. Unfortunately, there's no way you can use the File Types tab to add an extension to an existing file type.

However, you can do this via the Registry. Here are the steps to follow:

1. In the Registry Editor, open HKEY_CLASSES_ROOT.

2. Find the extension subkey for the file type you want to work with. For the Text Document file type, for example, find the .txt subkey.

3. Make a note of the value of the extension subkey's Default setting. For example, the Default setting for the .txt subkey is txtfile.

4. Highlight HKEY_CLASSES_ROOT and add a key for the new extension. In the 1ST extension example, you'd add a key named .1st.

5. For this new key, change the Default setting to the value you noted in step 3, as shown in Figure 13.7.

FIGURE 13.7. To associate an extension with an existing file type, you need to add the extension to the Registry.

After you've created this new key, it becomes available to Windows 98 immediately. To see for yourself, check out the file type in the File Types tab. You should see the new extension in the File type details group, as shown in Figure 13.8.

FIGURE 13.8. The new extension shows up in the File Types tab.

Modifying Windows 98's Desktop Icons

The default icons that populate the Windows 98 desktop are handy, but they can be annoyingly difficult to work with. For example, if you don't use My Computer, Network Neighborhood, or Recycle Bin, there's no way to delete them from the desktop. Also, you can rename all the desktop icons except for the Recycle Bin, which stubbornly refuses all renaming attempts.

Fortunately, all these problems are overcome easily with a few simple tweaks of the Registry. The next few sections show you some tricks for modifying the desktop icons.

Changing the Desktop Icons

If you're getting a bit a tired of seeing the same old icons on your desktop, changing these icons is a nice way to give Windows 98 a quick facelift. You learned in Chapter 6, "Customizing the Taskbar, Start Menu, and Display," that you can use the Icons tab of the Display Properties dialog box to change the icons for My Computer, Network Neighborhood, and the Recycle Bin. For the other desktop icons, you need to use the Registry.

Each desktop icon has a subkey in the following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID

CLSID is short for class ID, and each Windows 98 object has its own unique class ID. These are long, 16-byte values that consist of 32 hexadecimal digits arranged in an 8-4-4-4-12 pattern, surrounded by braces ({}). For example, the CLSID for My Computer is {20D04FE0-3AEA-1069-A2D8-08002B30309D}, so this is My Computer's Registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}

Table 13.1 lists the CLSID values for all the desktop icons.

Table 13.1. CLSID values for the desktop icons.

Desktop Icon - CLSID
My Computer - {20D04FE0-3AEA-1069-A2D8-08002B30309D}
My Documents - {450D8FBA-AD25-11D0-98A8-0800361B1103}
Internet Explorer - {3DC7A020-0ACD-11CF-A9BB-00AA004AE837}
Network - {208D2C60-3AEA-1069-A2D7-08002B30309D} Neighborhood
Set Up The - {4B876A40-4EE8-11D1-811E-00C04FB98EEC} Microsoft Network
Recycle Bin - {645FF040-5081-101B-9F08-00AA002F954E}
My Briefcase - {85BBD920-42A0-1069-A2E4-08002B30309D}


Each desktop icon key contains various subkeys. In particular, you'll find a subkey named DefaultIcon that determines the icon used by each object. By changing the Default setting in the DefaultIcon subkey, you can define new icons for your desktop.

The DefaultIcon subkey's Default setting always uses the following general value:

IconFile,IconNumber

Here, IconFile is the name of a file (plus the path, if the file isn't in the main Windows 98 folder or its System subfolder) that contains one or more icons. Most of the desktop icons use the file SHELL32.DLL.

IconNumber is an integer that specifies which icon to use in IconFile, in which the first icon is 0. For example, the Network Neighborhood's DefaultIcon setting is this:

shell32.dll,17

To change the icon, either specify a different icon number in the existing icon file or use a different icon file altogether.

How do you know which files contain which icons? The best way to browse icon files is to create a shortcut, open its properties sheet, select the Shortcut tab, and click the Change Icon button. In the Change Icon dialog box that appears, shown in Figure 13.9, use the File name text box to enter the name of an icon file (such as a DLL, an EXE, or an ICO file) and then press Tab. If you're not sure about which file to try, click the Browse button and choose a file in the dialog box that appears. Here are a few suggestions: C:\WINDOWS\SYSTEM\SHELL32.DLL

C:\WINDOWS\SYSTEM\PIFMGR.DLL

C:\WINDOWS\SYSTEM\USER.EXE

C:\WINDOWS\EXPLORER.EXE

C:\WINDOWS\MORICONS.DLL C:\WINDOWS\PROGMAN.EXE

FIGURE 13.9. Use the Change Icon dialog box to browse the available icons in an icon file.

After you've opened a file, use the Current icon box to browse the available icons. If you see an icon you want to use, you can get its icon number by counting from the first icon, starting at 0, until you get to the icon. Note that you must count down each column and work your way across the columns.

Deleting the Recycle Bin

You can delete most of the desktop icons by right-clicking an icon and then clicking Delete. (For the My Documents folder, right-click and then click the Remove from Desktop command.) Unfortunately, both the My Computer icon and the Network Neighborhood icon are permanent fixtures on the desktop, and so they can't be deleted. (However, I'll show you how to hide the Network Neighborhood icon a bit later.)

That just leaves the Recycle Bin, which can only be deleted by using the Registry. All you have to do is delete the appropriate subkey in the CLSID key:

HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}

Click the desktop and then press F5 to refresh the icons. The Recycle Bin will turn into a folder icon, which you can then delete normally.


EXPORT THE RECYCLE BIN KEY FIRST
Just in case you change your mind down the road, you should export the Recycle Bin's CLSID key before deleting it. To do so, highlight the key and then select Registry | Export Registry File.

Editing the Icon InfoTips

In Windows 98, when you point at any of the System Folder desktop icons, a banner called an InfoTip appears with a brief description of the icon. For example, Figure 13.10 shows the InfoTip that appears when you point at the Internet Explorer icon.

The InfoTip text is stored in the Registry, so you can edit the text to, for example, give further instructions to new users. To work with the InfoTip text, find the CLSID key for the desktop icon. As shown in Figure 13.10, you see an InfoTip setting. Just edit this string value to customize the InfoTip.

FIGURE 13.10. Each desktop icon has an InfoTip setting that holds the InfoTip text.

Hiding the Network Neighborhood

Although you can't delete the Network Neighborhood, you can hide it from view by creating a new Registry entry. First, use the Registry Editor to head for the following key:

HKEY_USERS\.Default\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

Create a new DWORD value named NoNetHood. If you assign the value 1 to this setting, Windows 98 hides the Network Neighborhood icon. (You need to restart Windows 98 to put this into effect.) To display the Network Neighborhood icon again, set NoNetHood to 0.

Saving Your Desktop Configuration

Have you ever carefully arranged your desktop icons, only to find that Windows 98 has reverted to its previous state? This is frustrating (and, thanks to its intermittent behavior, puzzling), but there is a workaround.

In the Registry Editor, head for the following key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

If you don't see a setting named NoSaveSettings, go ahead and add it as a binary value. Edit this new setting and enter the following value:

00 00 00 00

With this setting in place, Windows 98 will save your current desktop arrangement each time you shut down or reboot. Exit the Registry Editor, adjust your icons as necessary, and then restart Windows 98.

To tell Windows 98 not to save the desktop arrangement at shutdown, return to the Registry Editor and then change the NoSaveSettings value to the following:

01 00 00 00

Renaming the Recycle Bin

Except for the Recycle Bin, you can rename all the desktop icons. If the name "Recycle Bin" just doesn't cut it for you, you can assign this icon a new name--Trash Can, Garbage Pail, Rubbish Heap, Last Stop Before Deletesville, or whatever--via the Registry. First, head for the Recycle Bin's CLSID key:

HKEY_CLASSES_ROOT\CLSID\{645FF040-5081-101B-9F08-00AA002F954E}

To change the name, edit the Default setting for this key. Note, too, that clearing the title from this setting will display the Recycle Bin with no name. To see the change, click the desktop and then press F5 to refresh it.

Using the Registry to Fiddle with Files

Let's turn our attention now to some Registry techniques that operate on files. The next five sections introduce you to various Registry keys that change the way you work with files in Windows 98.

Adjusting Explorer's Refresh Rate

Windows 98 does a pretty good job of updating the Explorer window whenever you use another application to add, delete, or rename files. It sometimes misses some file updates, however, especially if the changes were made at the DOS prompt or with a DOS application. You can always update the Explorer display to show the latest information by selecting View | Refresh or by pressing F5. If, however, you want to make Explorer really diligent about keeping its display up-to-date, head for the following Registry key:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\control\Update

You see a setting named UpdateMode, which controls the Explorer refresh rate. To set this rate at its fastest, change the value of UpdateMode to 0.

Removing the Arrows from Shortcut Icons

If you use shortcuts regularly, you know that Windows 98 displays a small arrow in the lower-left corner of the shortcut icon. If you normally leave "Shortcut to" as part of the shortcut's name, you might prefer not to see the arrow. To tell Windows 98 not to add the arrow to your shortcuts, display the following Registry key:

HKEY_CLASSES_ROOT\lnkfile

In the Settings pane, find the IsShortcut setting and rename it (to, say, IsShortcutNot). Exit the Registry Editor to put this change into effect. (You don't need to restart Windows 98.)

Customizing the System Icons

Most of the Windows 98 system icons--such as those that appear in the Start menu and the default icons that Explorer uses for unknown file types and DOS applications--can be customized. To understand how, let's run through an example. First, use the technique I showed you earlier to browse the icons in Shell32.dll. As you can see in Figure 13.11, the first icon (icon 0) is the one Windows 98 uses in folder windows to display files with unregistered types. Suppose, instead, you want Windows 98 to display the chip icon, which is the one at the top of the fourth column (icon number 12).

FIGURE 13.11. The SHELL32.DLL file contains a couple of suitable replacements for the shortcut arrow.

To accomplish this replacement, follow these steps:

1. Use the Registry Editor to display the following key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\explorer
2. In the Shell Icons subkey, create a new string value setting named 0. This number corresponds to the position in Shell32.dll of the icon we want to replace.

3. Change the value of the 0 setting to shell32.dll,n, in which n is the number of the replacement icon you want to use. For this example, you enter shell32.dll,12, as shown in Figure 13.12.

Implementing this change isn't as straightforward as logging on again or restarting Windows 98. The problem is that Windows 98 stores all its system icons in a hidden file named ShellIconCache (you find it in your main Windows 98 folder). The change you just made to the Registry doesn't update this file, and neither does a restart of Windows 98.

FIGURE 13.12. You customize the system icons by adding new settings to the Shell Icons key.

To put the change into effect, open the properties sheet for the desktop, select the Appearance tab, and choose Icon from the Item drop-down list. Modify the Size value (it doesn't matter what number you choose), and click Apply. This action refreshes the ShellIconCache file and updates the system icons. Return the Icon item to its original size (you might also need to select Windows Standard from the Scheme drop-down list) and click OK to return the icons to their normal size.

As you might have guessed by now, you can use a similar technique to customize any of Windows 98's system icons. Use the Change Icon dialog box to get the appropriate number for the system icon in Shell32.dll (remember to start counting at 0) and create a string value setting for that number in the Shell Icons key. Change this setting to the icon file and icon number you want to use as a replacement.

To get you started, here are the setting names to use for the icons in the Start menu: Command - Setting Name Programs

Favorites

Documents

Settings

Find

Help

Run

Log Off

Suspend

Eject PC Shut Down

Using a Bitmap File's Own Image as Its Icon

Because bitmap files are associated with Paint, they're displayed in Explorer with Paint's icon. Wouldn't it be nice if, rather than the generic Paint icon, each bitmap file used its own image as its icon? With the Registry, all things are possible.

Open the following Registry key:

HKEY_CLASSES_ROOT\Paint.Picture\DefaultIcon

The Default setting for this key should have the following value:

C:\Progra~1\Access~1\MSPAINT.EXE,1

This is telling Windows 98 to use the generic Paint icon. Change this setting to %1. With this value, each BMP file uses its built-in icon handler to generate its own icon. This technique is normally used with EXE files that have icons imbedded inside them. Because a BMP file doesn't have an embedded icon, it just uses its own image.

After you've changed the Default setting, the new value goes into effect immediately. Switch to Explorer and select View | Refresh to update the display. For each BMP file, the contents of the file are used as the icon, as shown in Figure 13.13.

FIGURE 13.13. BMP files generating their own icons.

Clearing the MRU List in the Run Dialog Box

One of the features I hated most about Windows 3.x was the inability of the Run commands in Program Manager and File Manager to remember commands you entered previously. Thankfully, Windows 98 remedied that bit of brain-deadness by building a memory into the Start menu's Run command. This "memory" is actually the following Registry key:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\RunMRU

Here, MRU stands for Most Recently Used. As you can see in Figure 13.14, this key is just a list of commands that have been entered into the Run dialog box. Notice how each command is assigned a letter. The MRUList setting at the bottom determines the order in which commands appear by arranging these letters in the order you entered each command.

FIGURE 13.14. The list of commands in the Run dialog box is given by the RunMRU Registry key.

The Run feature will remember up to the last 26 commands you entered (because there are 26 letters in the alphabet). That's a lot of commands to wade through, so you might want to clear the MRU list from time to time and start fresh. To do so, delete every one of the lettered settings in the RunMRU key, as well as the MRUList setting (don't touch the (Default) setting, however).

Changing the Default Web View Templates

In Chapter 5, "Web Integration and the Active Desktop," I showed you how Windows 98 uses HTT files as templates for various folder Web views. For example, the file \Web\Folder.htt is used as the default template to display any folder in Web view. The name and location of these template files are stored in the Registry. This means you could create a custom HTT file, store it in a separate location (such as a shared folder on a server), and then change the appropriate Registry setting to point to that file.

For example, the default path and filename for the folder template is given by the PersistMoniker setting in the following Registry key (see Figure 13.15):

HKEY_CLASSES_ROOT\Directory\shellex\ExtShellFolderView\ Â{5984FFE0-28D4-11CF-AE66-08002B2E1262}

FIGURE 13.15. The Registry stores the default path and filename for the folder Web view templates.

Edit the PersistMoniker setting to point to the new location and filename.

For Control Panel, edit the PersistMoniker setting in the following key:

HKEY_CLASSES_ROOT\CLSID\{21EC2020-3AEA-1069-A2DD-08002B30309D}\shellex\ExtFolderViews\</DIV><DIV>{5984FFE0-28D4-11CF-AE66- Â08002B2E1262}<DIV>

For My Computer, edit the PersistMoniker setting in the following key:

HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shellex\ExtFolderViews\</DIV><DIV>{5984FFE0-28D4-11CF-AE66- Â08002B2E1262}</DIV>

Customizing the Windows 98 Interface

As you learned in Chapter 12, Windows 98 uses the Registry to store the current values of the various Control Panel settings. Of course, you can use the Registry Editor to edit these values directly, although you usually are better off using the dialog boxes and controls that the Control Panel icons give you.

Plenty of customization keys and settings in the Registry, however, can't be modified via the Control Panel. The next few sections show you a few of them.

Creating a Desktop Pattern Without a Mouse

In Chapter 6, I showed you how to create your own desktop pattern. Unfortunately, you have to use a mouse to create a custom pattern in the desktop properties sheet. The Registry, however, lets mouse-averse users create a cool pattern (albeit not quite as intuitively).

The secret to doing this can be found in the following Registry key:

HKEY_CURRENT_USER\Control Panel\desktop

When you apply a pattern to the desktop, this key contains a Pattern setting that's a string value consisting of eight numbers. These digits are a numeric representation of the pattern.

For example, consider the Circuits pattern shown in Figure 13.16. As you can see, the Pattern setting represents this pattern with the string 82 41 132 66 148 41 66 132. To see how Windows 98 derives these numbers, recall that each pattern is an 8x8 array of pixels. Each pixel is either "on" (that is, black) or "off" (that is, the desktop color). The following grid shows the On/Off values that make up the Circuits pattern: Off - On - Off - On - Off - Off

Off - Off - On - Off - On - Off - Off

On - Off - Off - Off - Off - On - Off

Off - On - Off - Off - Off - Off

On - Off - Off - On - Off - On - Off

Off - Off - On - Off - On - Off - Off

Off - On - Off - Off - Off - Off On - Off - Off - Off - Off - On - Off

FIGURE 13.16. Desktop patterns are represented in the Registry as a string of numbers.

In computing circles, however, "on" is usually represented by a 1, and "off" is usually represented by a 0. So you can rewrite the preceding grid as the following series of 1s and 0s:

01010010
00101001
10000100
01000010
10010100
00101001
01000010
10000100

Each of these rows, however, can be read as a binary number. Now try this little experiment:

1. Select Start | Programs | Accessories | Calculator.

2. Select View | Scientific to display the Scientific view (if it's not already displayed).

3. Activate the Bin option.

4. Enter the first row--01010010--into the readout.

5. Activate the Dec option. The binary number you entered changes to 82 in decimal format. If you look back at Figure 13.15, you'll see that 82 is the first number of the Pattern setting.

If you repeat steps 3 through 5 for the other rows, you see that their decimal equivalents are all in the Pattern setting. In other words, the Pattern setting uses decimal values to represent the binary nature of the pattern.

So to create your own pattern, you need only adjust the Pattern setting. The best way to do this is to create an 8x8 grid, fill it with 1s and 0s in a pattern that looks interesting, and use Calculator to convert the resulting binary numbers in decimal values that you can use with the Pattern setting

Disabling Window Animation

One of the pet peeves many new users had with Windows 3.x was that they would click a window's Minimize button (accidentally or otherwise) and the window would "disappear." They didn't realize that it was still there, just minimized as an icon at the bottom of the screen.

To help these users, Microsoft decided to "animate" windows as they were minimized to the taskbar. In other words, when you click the Minimize button in Windows 98, the window's title bar flashes quickly, and then you see the window retreating to the taskbar. (You get the same show when you restore the window from the taskbar.) This is called window animation, and it's a real help to novice users because they can follow the window down to the taskbar.

The rest of us, however, know where the window goes when we click the Minimize button, so we don't need to bother with the animation. To have your windows snap into place, you can turn off window animation by using the Registry.

The place to be is the following key:

HKEY_CURRENT_USER\Control Panel\desktop\WindowMetrics

Create a new string value setting called MinAnimate, and then change the value of this setting to 0. Exit the Registry Editor and restart Windows 98 (or log on again) to set up the change.

Playing with Button Shadows

In Chapter 6 I showed you how to use the desktop properties sheet to modify Windows 98's colors. A few objects can't have their colors modified with this method. They're in the Registry, however, so you can work with them there.

Windows 98's 3D objects appear with either a "raised" or a "sunken" effect. Command buttons, for example, appear raised, whereas text boxes appear sunken. These effects are achieved by small strips of color around each object. On the top and left side of a raised object are, for example, a strip of light gray and a strip of white; on the bottom and right side are a strip of dark gray and a strip of black. Sunken objects use an opposite color scheme. These colors are controlled by settings in the following Registry key:

HKEY_CURRENT_USER\Control Panel\Colors


THE Colors SUBKEY MIGHT NOT APPEAR
The Colors subkey appears only if you've modified Windows 98's colors via the desktop properties sheet. If you don't see the Colors subkey, open the desktop properties sheet, select the Appearance tab, change the color of any object, and click Apply. Change the color back and click OK. When you're back in the Registry, select View | Refresh to see the Colors subkey.

As you can see in Figure 13.17, this key has many settings that hold the RGB color values of various objects. In particular, four settings control the color of the strips around 3D objects. Table 13.2 lists these settings and shows their default values. For something a bit different, you can reverse the raised and sunken objects by using the values in the Reversed column of the table. Figure 13.18 shows the result (you need to restart Windows 98 to put the new colors into effect).

FIGURE 13.17. The Colors key uses RGB values to store the color of various Windows 98 objects.

Table 13.2. Color settings for 3D objects.

Setting Default Reversed
ButtonDkShadow 0 0 0 (black) 255 255 255
ButtonHiLight 255 255 255 (white) 0 0 0
ButtonLight 223 223 223 (light gray) 128 128 128
ButtonShadow 128 128 128 (dark gray) 223 223 223


FIGURE 13.18. An interesting effect created by switching the color values for the settings that create 3D objects.

What do you do if you want to try other colors, but you don't know the appropriate RGB values? Windows 98 has a color picker that can help you. Open the desktop properties sheet, select the Appearance tab, drop down either Color list, and click Other. The Color dialog box is displayed. Click a color you like and then use the Red, Green, and Blue text boxes to make a note of the RGB value.

Getting Better Double-Clicking

In Chapter 8, "Customizing the Mouse, Keyboard, and Other Input Devices," I showed you how to customize various aspects of your electronic rodent. In particular, I showed you how to modify the double-click speed so that Windows 98 is better able to recognize your double-clicks. If Windows 98 is still balking at some of your double-clicks, or if you're administering novice users who are complaining about this situation, the problem might not be the double-click speed. You see, Windows 98 actually uses two criteria to differentiate between a double-click and two single-clicks:

The latter criterion is often the real cause of misinterpreted double-clicks for novice users who are still a little unsteady with the mouse. To give them more room to maneuver, you can use the Registry to increase the double-click distance. Begin by highlighting the following key in the Registry Editor:

HKEY_CURRENT_USER\Control Panel\desktop

Now create two new string value settings: DoubleClickHeight and DoubleClickWidth. These settings specify how far the mouse pointer is allowed to travel (in pixels) between each click. I'd suggest starting with values of 10 for each setting and experimenting from there.

Setting the Number of Lines Scrolled with the IntelliMouse Wheel

If you have an IntelliMouse--the mouse with the wheel in the middle--Windows 98 enables you to scroll up and down within a list or window by rotating the wheel forward and back. The default number of lines scrolled is three with each discrete movement of the wheel. To change the number of lines, head once again to the following key in the Registry Editor:

HKEY_CURRENT_USER\Control Panel\desktop

Create a new string value called WheelScrollLines and set it to the number of lines you want to scroll. You need to restart Windows 98 (or log on again) to put this into effect.

Customizing Some Setup Settings

To finish this look at Registry tricks and secrets, I'll close with a couple of techniques for modifying some of the settings you specified during Setup.

Changing Your Registered Name and Company Name

During the Windows 98 installation process, Setup may have asked you to enter your name and, optionally, your company name. (If you upgraded from Windows 95, this data was recorded when you ran the Windows 95 Setup program.) These "registered names" appear in several places as you work with Windows 98:

With these names appearing in so many places, what do you do if you change one of the names? Why, head for the Registry, of course. In particular, make tracks to the following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion

This key has two settings that store your registered names: RegisteredOrganization and RegisteredOwner. Use these settings to tell Windows 98 that you want to use different registered names.

Changing the Windows 98 Source Path

When you install Windows 98, Setup makes a note of the disk drive you used for the source CD-ROM or floppy disks. Later, when you add new Windows 98 applets or adjust your hardware, Windows 98 prompts you to insert a source disk in the same drive. You might, however, need to change this source path:

For all these situations, you can let Windows 98 know that the source path has changed. In the Registry Editor, highlight the following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup

Find the SourcePath setting and change it to the new path. For example, if you installed Windows 98 originally from floppies in drive A, the SourcePath setting will be A:\. If you now have the CD-ROM and your CD-ROM drive is drive D, change SourcePath to D:\WIN95.

Summary

This chapter put your hard-won knowledge from Chapter 12 to good use by showing you a few practical tips and tricks for modifying the Registry. I showed you how to customize the New menu, create application-specific paths, modify the desktop icons, change various file settings, customize the Windows 98 interface, and make a couple of post-Setup alterations. All in all, not a bad day's work.

I'll be using the Registry throughout the rest of this book, but here are a couple of related chapters you might want to check out:



Contents

© Copyright, Macmillan Publishing. All rights reserved.