Microsoft Windows Registry Guide, Second Edition
General
In the General category, the items in the Settings list are effects that you can enable or disable. In fact, the Settings list, shown in Figure 5-1, used to be called the Effects list in earlier versions of Tweak UI. Settings range from list box and window animations to menu fading. Disable these settings only on slower computers when you think disabling them can improve the computer's performance; otherwise, these settings make Windows look great.
Table 5-1 lists all the settings in the General category. One value needs a bit of explaining, though: UserPreferencesMask. The bits in this REG_BINARY value are various settings, which Chapter 4, “Hacking the Registry,” and Appendix C, “Per-User Settings,” describe in detail. To turn on a setting, set the appropriate bit to 1 in UserPreferencesMask. To turn off a setting, clear the corresponding bit. The number in the Data column tells you which bit to toggle. The easiest way to toggle the bit is to use Calculator in scientific view. Bitwise math is beyond most simple scripting techniques, including REG files. If you want to create a script to change the settings in UserPreferencesMask, use INF files or look to Windows Script Host (WSH). (See Chapter 11, “Scripting Registry Changes.”)
Figure 5-1 Many of these settings are in the Performance Options dialog box. Right-click My Computer, click Properties, and in the Performance section of the Advanced tab click Settings.
TIP
UserPreferencesMask is an example of a REG_DWORD value disguised as a REG_BINARY value. When you see a 32-bit binary value, it's likely that it's really a double-word value. In that case, you can safely replace the value with a REG_DWORD value. Don't forget that Windows uses the little-endian architecture, though, so it stores double-word values in reverse-byte order. In other words, you replace the REG_BINARY value 0x04 0x03 0x02 0x01 with the REG_DWORD 0x01020304. See Chapter 1, “Learning the Basics,” for a refresher on little-endian architecture and bitwise math.
Setting | Name | Type | Data | |||
HKCU\Control Panel\Sound | ||||||
Beep on errors | Beep | REG_SZ | Yes | No | |||
HKCU\Control Panel\Desktop | ||||||
Enable combo box animation | UserPreferencesMask | REG_BINARY | Bit 0x0004 | |||
Enable cursor shadow | UserPreferencesMask | REG_BINARY | Bit 0x2000 | |||
Enable list box animation | UserPreferencesMask | REG_BINARY | Bit 0x0008 | |||
Enable menu animation | UserPreferencesMask | REG_BINARY | Bit 0x0002 | |||
Enable menu fading | UserPreferencesMask | REG_BINARY | Bit 0x0200 | |||
Enable menu selection fading | UserPreferencesMask | REG_BINARY | Bit 0x0400 | |||
Enable mouse hot tracking effects | UserPreferencesMask | REG_BINARY | Bit 0x0080 | |||
Enable tooltip animation | UserPreferencesMask | REG_BINARY | Bit 0x0800 | |||
Enable tooltip fade | UserPreferencesMask | REG_BINARY | Bit 0x1000 | |||
Show Windows version on desktop | PaintDesktopVersion | REG_DWORD | 0X00 | 0X01 | |||
HKCU\Control Panel\Desktop\WindowMetrics | ||||||
Enable Window Animation | MinAnimate | REG_SZ | 0 | 1 | |||
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\OptimalLayout | ||||||
Optimize hard disk when idle | EnableAutoLayout | REG_DWORD | 0 | 1 |
Tracking Down Tweak UI Settings
Are you curious about how I tracked down all the Tweak UI program's settings? I used the techniques you learn about in Chapter 10, “Finding Registry Settings.” The first technique uses a program from Winternals Software called Registry Monitor (Regmon), which monitors access to the registry. It reports every setting that Windows or other programs read or write.
The second technique, and the one that I used most, is to compare snapshots of the registry before and after making the change. Here's how that process worked for me while writing this chapter:
Export the branch of the registry that you suspect contains the setting to a REG file. If in doubt, export the entire registry. Name the file Before.reg.
Change the setting. In this case, change a setting in Tweak UI.
Export the same branch of the registry that you exported in step 1. Name the file After.reg.
Compare both files; the differences between them represent the changes in the registry.
The primary tool that I use for comparing REG files is Windiff, which comes with the Windows Support Tools and the Windows 2000 Resource Kit. If you don't have Windiff, you can use Microsoft Office Word 2003 just as effectively: open the first REG file in Word, and then, from the Tools menu, click Compare And Merge Documents to compare it with the second file.
Focus
When an application needs your attention–or when it simply wants to annoy you–it steals the focus from the application in which you're currently working. This leads to frustration as you flip back and forth between windows. The settings in the Focus category prevent that scenario; they get your attention by causing applications to flash their taskbar buttons rather than stealing focus from the application in the foreground.
Table 5-2 describes the settings in the Focus category. The default value for ForegroundLockTimeout is 0x00030D40, or 200000. This value is the time in milliseconds before Windows allows an application to steal the focus from the foreground application. To convert 200,000 to seconds, divide it by 1000 (200 seconds). You see the value ForegroundFlashCount in the table twice, because setting it to 0 causes the taskbar button to flash until you click it; otherwise, the taskbar button flashes the number of times you set in ForegroundFlashCount.
Setting | Name | Type | Data |
HKCU\Control Panel\Desktop | |||
Prevent applications from stealing focus | ForegroundLockTimeout | REG_DWORD | N |
Flash taskbar button until I click on it | ForegroundFlashCount | REG_DWORD | 0x00 |
Flash taskbar button N times | ForegroundFlashCount | REG_DWORD | N |
ALT+TAB
The settings in the ALT+TAB category configure the number of rows and columns that you see when you press ALT+TAB. The REG_SZ value for the Rows setting is CoolSwitchRows. The REG_SZ value for the Columns setting is CoolSwitchColumns. Both values are in HKCU\Control Panel\Desktop. Be careful that you don't configure so many rows and columns that the window no longer fits on the screen. To take effect, this setting requires that you log off and back on to Windows.