|
|
|
|
Optimizing the Windows Registry
Last Updated 2/3/2009 3:42:59 PM
Abstract
This chapter covers the registry key HKEY_CURRENT_CONFIG and its subkeys.
THIS REGISTRY KEY ISNT REAL its an alias (subset) of HKEY_LOCAL_MACHINE. The specific key under HKEY_LOCAL_MACHINE that provides the alias differs between Windows 95/98 and Windows NT 4.
|
Tip: When you back up your registry, either with backup software or by exporting the registry, this key is not backed up because its merely a duplicate of part of an existing key. In fact, only HKEY_LOCAL_MACHINE and HKEY_USERS are backed up or exported during a registry backup. All the other keys, including the one were discussing here (HKEY_CURRENT_CONFIG) are created during system startup by duplicating the appropriate subset from the two major keys. If you change the registry in either the main key or the subset, the change is written to both keys. |
HKEY_CURRENT_CONFIG IN WINDOWS 95 AND 98
In Windows 95 and 98, this key is an alias for HKEY_LOCAL_MACHINE\Config\Profile# where the profile number is 0001, 0002, and so on (see Figure 17-1).
Profile refers to hardware profiles, not user profiles. If multiple hardware profiles arent enabled for the computer, the single existing profile is numbered 0001.
When you expand the registry key HKEY_CURRENT_CONFIG, you see two subkeys: Display and System. Under these keys are the configuration data values for the current hardware configuration of the computer.
Display Subkey
Expand the Display subkey to see its two subkeys: Fonts and Settings. These subkeys hold data values that regulate the display of operating system elements.
fontS
The \Display\Fonts subkey specifies the fonts currently being used by the operating system (as opposed to application software). These are system screen fonts, not TrueType fonts (see Figure 17-2).
You can make font changes directly in the registry if you know the exact names of the fonts you want to use, but its far easier and safer to use the Display Properties dialog box to make changes (see Figure 17-3). You can open the Display icon in the Control Panel, or right-click on a blank spot on the desktop and choose Properties.
To change fonts, move to the Appearance tab and select a system element that involves fonts from the Item text box (youll know if the element has a font option because the Font text box becomes accessible). Then, move to the Font text box and change the font. When you click OK, the change is made and takes effect immediately. In fact, the registry uses these system icons (see Figure 17-4).
The data values in this subkey are strings, so you could make changes directly into the registry except you cant figure out which font goes with which item, so youre really not sure what youre changing. This data listing doesnt assign fonts to specific elements in Windows, it just lists the available fonts. For instance, the font change I made to produce the unreadable data panel was for Icon fonts (so the registry data must be considered an icon title).
SETTINGS
The data in \Display\Settings shows the Window metrics for the operating system (again, not for application software). This data specifies size, color, and resolution (see Figure 17-5).
The data is interpreted as follows:
- BitsPerPixel is a symbol that stands for color depth (in this case 8, which means 256-color).
- DPILogicalX is the number of horizontal dots per inch for the font display.
- DPILogicalY is the number of vertical dots per inch for the font display.
- DPIPhysicalX is the actual number of dots per inch displayed horizontally on your monitor.
- DPIPhysicalY is the actual number of dots per inch displayed vertically on your monitor.
- Fixedfon.fon is the name of the screen font.
- Fonts.fon is the filename for the screen font.
- Oemfonts.fon is the filename for the oem fonts.
- Resolution is the selected screen resolution (which always refers to pixels).
All these data items are strings, which means you could make changes directly to the registry but its not a good idea to make changes this way. Instead, use the Settings tab of the Display Properties dialog box (see Figure 17-6).
The two items in this registry key that refer to the actual number of dots per inch displayed on your monitor are a function of the monitor and how Windows 95 and 98 believe the monitor behaves. You can change the monitor setting by choosing Change Display Type on the Settings tab of the Display Properties dialog box. When the Change Display Type dialog box opens, the current settings appear (see Figure 17-7).
To change the actual display, you need to choose Change in the Monitor Type section of the dialog box, and then select a monitor type that will accommodate the changes you want to make (and the new monitor type has to be acceptable to your physical monitor). Before doing this, however, you should speak to the manufacturer.
System Subkey
I find this subkey to be an interesting approach to registry information and you can read the word interesting as if it had a question mark. The subkey expands to show a number of additional subkeys (see Figure 17-8); theres not much logic to this tree because most of the data panels really dont contain any information.
The subkey Printers has the name of the default printer in its data panel. At the bottom of the tree, subkeys appear for each printer installed on this computer, but none of those subkeys contain any data. Additionally, youll find a subkey named Rendering Subsystem, which probably refers to the printer drivers but theres no way to tell, because that subkey doesnt contain any data either.
Makes you wonder why Microsoft called this subkey System instead of Printers.
HKEY_CURRENT_CONFIG IN WINDOWS NT 4
This registry key is new to Windows NT (with Windows NT 4), and it represents the currently used hardware profile. It is an alias to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Hardware Profiles\Current (see Figure 17-9).
This key was added to Windows NT 4 to make the operating system compatible with the same key in Windows 95 and 98. That way, programs that use data in the subtree HKEY_CURRENT_CONFIG can function on all three operating systems.
Caution: Do not take the compatibility rationale to mean that compatibility exists between the registries in Windows 95/98 and Windows NT 4. It doesnt! This compatibility is in structure only and is a service to programmers.
If you program for Windows NT 4 and need to insert data in the Class and Enum subkeys of HKEY_CURRENT_CONFIG, you still have to use the Device Installer API (or the Config Manager API). If you refer to the subtree by path, the application wont run on Windows 95 or 98. |
In Windows NT 4, when a configuration change for a specific profile is made to a value entry in the Software or System subkeys in HKEY_LOCAL_MACHINE, the original value entry doesnt change. The change is made only to the appropriate section that is the duplicate for HKEY_CURRENT_CONFIG.
When you expand HKEY_CURRENT_CONFIG, you see two subkeys: Software and System. The System subkey expands to show the other subkeys shown in Figure 17-9.
If you havent created additional profiles nor made hardware changes to the default settings, the subkeys in HKEY_CURRENT_CONFIG are devoid of data except for the display settings in HKEY_CURRENT_CONFIG\System\CurrentControlSet\Services\X\DeviceY, where X is the name of your video adapter and Y is the number of the particular device (starting with 0). Information about video settings appears in the data panel (see Figure 17-10).
SUMMARY
In this chapter, you learned about HKEY_CURRENT_CONFIG, which is an alias of HKEY_LOCAL_MACHINE. We also covered the different subkeys that can be found under HKEY_CURRENT_CONFIG.
|
Page: 1 |
|
|
|