Yahoo

 

Home

Journal Contents List

Next - Article Number 3

 

Internal Links

 

THE WINDOWS REGISTRY
PART 4

by Brian Grainger: email.gif (183 bytes)brian@grainger1.freeserve.co.uk


This article will be published in the ICPUGSE Newsletter Number 111
Have a look at the ICPUGSE web pages for details on how to join ICPUGSE

 

INTRODUCTION

Last time I looked at the subkeys within HKEY_LOCAL_MACHINE and an example of how manipulating the Registry could affect what programs opened on Windows start up. This time I want to look at the subkeys within HKEY_USERS but first I want to revisit one of the original questions which sparked off this series, the most confusing question about why it appears that sometimes the Registry is not necessary at all.

IS THE REGISTRY NECESSARY?

Since the last article in the series was published Barry Biddles, as it was he who prompted the original questions, e-mailed me to clarify what he meant by asking whether the Registry was sometimes not necessary.

What he found was some instances where application software does not use the Registry. I totally agree with this. In such cases it would not matter what the Registry had in it, the application software would still work. However, since Windows itself uses the Registry it is obviously a component you cannot throw away. Consequently the Registry is essential for Windows itself but not always necessary for application software.

There is a corollary to this. Software written for Windows 3.x will not always use the Registry. I was reminded of this recently. I still use File Manager and on my new Windows 98 PC it would always come up displaying dates in the US format. My date settings were British and there was no setting within File Manager so I was confused. File Manager worked properly on my old Windows 95 PC so I tried copying the File Manager from there to my new PC. Still it would not work! Then, by chance, I found out what the problem was. I happened to look at WIN.INI, which is not used by Windows 95/98, and saw that the date setting was US format. Then the penny dropped. Despite File Manager being updated for Windows 95/98 it still worked like a Windows 3.x application, for which it was developed. Consequently it used WIN.INI and NOT the Registry! I then thought that there was a horrible bug within Windows 95/98 whereby changing the setting in Control Panel would only alter the Registry and not the WIN.INI (or SYSTEM.INI) file. However, I proved this theory wrong by using Control panel to change my date setting from British to US format and then changing it back again! File Manager displayed the dates properly at last! My final theory is that there is a bug in the Windows 98 setup program. During the setup process it asks for the international setting but this is before the Windows GUI is initialised. I can only assume that setup initialises the Registry with the setting but forgets to alter WIN.INI from the default. I guess it would be OK if you are upgrading from Windows 3.x, where WIN.INI would have the right setting already in place, but not for a brand new installation where there is no WIN.INI to start from. Those of you with PCs that have had Windows 95/98 from new may wish to check your settings in WIN.INI. They are in the section labelled [intl].

STRUCTURE OF HKEY_USERS

You will find at least one subkey under HKEY_USERS. This is .Default which contains the profile configuration information for a default user. If your PC is set up to accept user profiles then you may find other subkeys relating to these individual profiles. The information in the .Default subkey is used to create the user profile for a user who logs on without a personal user profile.

The subkey, whether the default profile or a specific user profile, contains all the information necessary to set up a particular user environment on the computer, such as application preferences, screen colours, and security access permissions. Many of these settings are the same kind of information that was stored in WIN.INI under Windows 3.x. Let us have a look at some of the subkeys of a profile.

AppEvents

This section is solely concerned with the various sounds that emanate when various events happen, such as starting Windows, emptying the recycle bin, etc. Those of you with the Plus pack will be aware that various sound/bitmap schemes exist so you can customise the look and sound of your PC. When Sounds is opened from the Control Panel Windows reads and modifies this part of the Registry.

The EventLabels subkey contains further subkeys which define the labels for events. These labels are used in the Schemes part of the hierarchy. Each label key has text data which describes the event. These appear in the Events box when Sounds is opened from Control Panel.

The Schemes subkey contains two subkeys, Names and Apps.

The Names subkey contains a subkey for each sound scheme you have installed on the PC. There will always be a .Default (for the Windows default sound scheme) and a .None (for no sounds at all). In addition you may find such things as Robotz0, Jungle0, etc. Each sound scheme key will have a default value with text data which describes the sound scheme. These appear in the Schemes box when Sounds is opened from Control Panel.

The Apps subkey contains a hierarchy of keys which subdivide into every possible event that can occur. This hierarchy maps directly onto the display in the Events box when Sounds is opened from Control Panel. Sometimes the subkey is an event label, in which case the text description for that event label key has to be picked up in order to be displayed. When the lowest level of event is reached in this hierarchy we find one or more subkeys. One of these will be .Current and then there may be others reflecting the names found under the Names subkey. Each of these subkeys has text data which defines the pathname of the sound file that is played when the event happens. These appear in the Sound Names box when Sounds is opened from the Control Panel and the corresponding event is selected. The text data associated with the .Current subkey is clearly the current setting for the event sound file.

Control Panel

This section contains subkeys for various Control Panel settings, including information that was stored in WIN.INI and CONTROL.INI under Windows 3.x. It is useful to have a look at the keys and data in this section in conjunction with the options available in the various Control Panel settings. You will find the Registry stores many settings as numbers rather than the descriptions seen in the Control Panel dialogs. The number 1 generally means true or ticked. The number 0 means false or not ticked. Where you might have a 3 radio button choice in a Control Panel dialog the selection may be stored in the Registry as a number 1, 2 or 3. A slider bar in a Control Panel dialog will usually translate into a number setting in the Registry.

A word of warning, some subkeys may not exist until a Control Panel setting is changed! For example, if you have not changed the keyboard repeat delay or keyboard rate you will not see a subkey for keyboard under Control Panel. However, make a change and the subkey appears and stays there for evermore! The subkeys that existed on my Windows 95 machine before I started playing were: Appearance; Cursors; Desktop; International. On my Windows 98 machine I had in addition: Accessibility; PowerCfg.

The data that appears for the Appearance subkey defines the current colour scheme in operation and something to do with custom colours. The Schemes subkey data lists all the available colour schemes. These are listed in the Schemes box when the Appearance tab is selected after Display is opened from Control Panel.

The data that appears for the Cursors subkey, if it exists, defines the current cursor (pointer) scheme in operation. The Schemes subkey data lists all the available cursor (pointer) schemes. These are listed in the Scheme box when the Pointers tab is selected after Mouse is opened from Control Panel.

The data for the Desktop subkey is a bit of a mixture. There are Wallpaper and Screen Saver options, which reflect changes made after Display is opened from Control Panel. There is also cursor blink rate data which reflects the setting when Keyboard is opened from Control Panel. There is also a data setting for DragFullWindows. On my Windows 95 release 950 there seems to be no way to alter this setting with Control Panel. Windows 98 has added an Effects tab when Display is chosen from Control Panel. The DragFullWindows data is 0 or 1 depending on whether the 'Show window contents while dragging' option on the Effects tab is cleared or ticked. Windows 95 users will have to change the Registry data for DragFullWindows and restart the PC to see the effect. There are a couple of subkeys for Desktop. The purpose of ResourceLocale is unknown to me. The data for WindowMetrics is clearly related to the way windows are displayed. They seem to correspond to the settings that can be made by selecting options in the Item box when the Appearance tab is selected after Display is opened from Control Panel. Unfortunately the relationship between the values in the Registry and the size settings selected in Control Panel is a mystery!

There is only one item of data for the International subkey of Control Panel. This gives a number for Locale. This is related to the chosen Regional Setting that can be altered by opening Regional Settings from Control Panel. English(British)/English(UK) is shown in the Locale data as 00000809. English (US) is shown as 00000409. Interestingly, the ResourceLocale data mentioned above for the Desktop subkey is 00000409 on my PC, whereas the Locale for the International subkey is 00000809. This presumably means I have a US desktop whereas my International settings are British. Is there a British Desktop, where the Network Neighborhood icon is spelt properly? I do not think so.

InstallLocationsMRU

The Windows 98 Resource Kit says that this subkey has data which contains the pathnames from which applications were most recently installed, (MRU stands for "most recently used"). However, I would question this. My PC shows 5 values (a, b, c, d, e). The data for each is a different pathname and the value MRUList shows data edcba, which presumably means that most recent install was done from the pathname given by value e. However, the most recent pathnames start with 'D:', whereas I have my hard drive partitioned into 3 parts which means my CD-ROM is 'F:'. I have certainly installed applications from the F: drive so I would expect some data values to show this. Clearly, not all installations are taken into account when the MRU list is drawn up. The question is which installations are considered relevant? I have no answer, except to say that nothing I have installed since the machine was delivered to me was relevant. I find this very strange since Windows 98 was only partially set up on delivery. On most new machines an OEM setup process is done by the supplier and then when the buyer first starts the machine Windows 98 is fully installed according to the customisation defined by the user.

Keyboard Layout

Comparing my Windows 98 and Windows 95 Registry it would seem that, for the Keyboard Layout subkey, there are variations between the two. The common factor is a subkey called preload which contains another called 1.This has data of 00000809 which defines the keyboard layout selected in the Language box when the Language tab is selected after Keyboard is opened from Control Panel. The numbers used in the Registry are the same as those for the International settings so in my case I have a keyboard layout of English(British). I suspect additional subkeys would appear if some of the other options are set after Keyboard is opened from the Control Panel.

Network

This section contains subkeys defining the persistent and recent network connections. This is NOT what networks you have logged on to but what CONNECTIONS have been made. My PC is permanently logged on through Windows Logon but this does not show up in the Registry here. What does show up is a subkey under the Recent subkey. The subkey is named with the pathname to a recent connection, namely that to my other computer. The data under this subkey shows the connection type, the network providing the connection and the user name used. The last two items are text data and fairly obvious. The connection type data is a double word binary value of 1. Since I used Direct Cable Connection for my network connection I presume that 1 is the Registry equivalent for DCC.

RemoteAccess

This part of the Registry contains address and profile subkeys for remote network access, that is connection from your PC to remote networks, usually via a modem. This area of the Registry is affected by your usage of Dial-Up Networking. The RemoteAccess subkey has some data attached. The AreaCode value lists all telephone area codes that have been defined when making new connections with Dial-Up Networking. The Default value gives the default Dial-Up Networking connection.

The Addresses subkey has one value associated with each connection created with Dial-Up Networking. The name of the value is the name of the connection and there is binary data associated with it, the meaning of which is not known to me.

The profile subkey has further subkeys for each connection that has a profile. Your Internet connection probably has a profile. Various values are associated with it including User, the data for which is the Logon ID.

Software

Contains subkeys describing the user's software settings and containing application specific information that was stored in WIN.INI or private initialisation files under Windows 3.x. Just as with the Software subkey in HKEY_LOCAL_MACHINE there is a wealth of information here. The subkey structure is almost identical to that in HKEY_LOCAL_MACHINE but the data is user specific rather than computer specific. As an example search:

Software\Microsoft\Windows\CurrentVersion\Applets\Wordpad

You will see a subkey called Recent File List and it holds data on the last 4 files opened. This is what you see at the end of the File menu of WordPad. If your PC was set up for multiple users, each with their own profile, then this Recent File List could be different for each one.

The Software part of HKEY_USERS is very dynamic changing as various user options are modified or even just by operation as data about window sizes, for example, is maintained. A look at this area might tell you what software you have been using. If you are one to add and remove many pieces of software you might find this section extremely large.

CONTROLLING THE OPERATION OF MENUS

In the above discussion I mentioned how the effect of dragging windows could be modified by altering a Registry setting in HKEY_USERS. I want to finish this time by looking at how to modify the display of menus by altering a key which does not exist by default! I wish Microsoft would explain how we are to find out about things that are not there! Fortunately, in this instance I am indebted to Windows 95 Annoyances for pointing me in the right direction.

Those of you who made the transition from Windows 3.x to Windows 95 may remember the surprise when you found the presence of submenus that opened automatically. This is relevant not just in applications but even more so on the Start Menu. In Windows 3.x submenus did not really exist in applications. The submenu items were structured in a dialog box. The presence of a dialog box was denoted by an ellipsis following a menu item. In Program Manager, for example, on the File menu would be found 'New...'. This would open up to a dialog box which requested whether you wanted a new Program Group or a new Program Item. In order to see the dialog box you would have to click 'New...'. The equivalent process in Windows 95 is in Windows Explorer. You click on the File menu of Explorer and move the mouse to New and automatically a submenu appears with Folder, Shortcut and perhaps other items on it. No clicking of New is required. Now you may find this a great idea, except the submenu may appear too slowly! Alternatively, those who are troubled by using the mouse can find it daunting that submenus suddenly appear just by moving a mouse. I have sometimes opened the wrong item from the Start Menu because a submenu has appeared. The purpose of this Registry tweak is to make sub menus appear according to our preference, either to change the speed of their appearance, or to demand that a mouse click is required before the submenu opens. You will not find any setting in Control Panel to adjust this behaviour. Neither will you find a Registry key to adjust it, but you can create one!

Open your Registry Editor and highlight the following key:

HKEY_CURRENT_USER\ Control Panel\Desktop

Make sure you highlight Desktop and not one of its subkeys. You should find values such as CursorBlinkRate and wallpaper displayed. I am using HKEY_CURRENT_USER rather than HKEY_USER to ensure only the logged in user is affected. HKEY_CURRENT_USER is just a pointer into the appropriate branch of HKEY_USER.

When the Desktop key is highlighted you need to add a new value. From the Edit menu of the Registry Editor select New and then String Value and change the name of the automatically created value to:

MenuShowDelay

Right click on the new value and choose Modify

Enter Value Data as a number between 1 and 65534 and click OK. A data value of 1 will make submenus open faster than normal. A data value of 65534 will ensure submenus do not open until you click the parent menu. The speed of opening submenus will vary between these two extremes by choosing a data value between 1 and 65534.

You will need to restart Windows for the change to take effect.

Note that this change will NOT effect the display of parent menus in applications. Once one menu is clicked they will still appear according to the position of the mouse. It will, however, affect the display of application submenus.

CONCLUSION

With the above I have more or less covered the lower structure of the Registry. As was mentioned in Part 2, the other Handle keys are pointers into areas we have already covered in this article and Part 3. Next time I want to complete my resume of the Registry structure by revisiting some open questions in the previous discussions, (in the light of the Windows 98 Resource Kit), and briefly discuss the subkeys of HKEY_DYN_DATA. In what I expect to be the final part of the series I also hope to introduce some more Registry tweaks.

In preparing this article I have used the following data sources and thanks are given to the individuals concerned in their preparation.

Windows 98 Resource Kit (initiated by Microsoft)
Windows95 Annoyances (initiated by a very smart person who is not named!)


What's New at ICPUG

Home

Back to Top

Next - Article Number 3

Journal Contents