Property Sheet Handlers

When a user chooses Properties from the context menu of a file object, Windows 95 displays a property sheet for that file type. At a minimum, you'll see a General property sheet page with information about the file, including its type, location, size, and so on, as shown in Figure 13-5.

Figure 13-5.

The standard property sheet for a file object.

If you want to offer more information about files of a certain type (whether the file has been checked by an individual, for instance, or when the file was most recently backed up), you can customize the property sheet for that file type by implementing and registering a property sheet handler. I used a property sheet handler to add an extra page to the property sheet that is shown in Figure 13-6. This page simply serves to show that the property sheet extension has been installed and registered for NWC files.

Figure 13-6.

A property sheet page added by a user interface extension.

Like the other user interface extensions you've seen, property sheet handlers must be registered in the Registry. These handlers use the PropertySheetHandlers key to store their CLSIDs. Here is the part of the REG file that registers the property sheet handler for NWCFile:

[HKEY_CLASSES_ROOT\NWCFile\shellex\PropertySheetHandlers]
@="NWCPage"
[HKEY_CLASSES_ROOT\NWCFile\shellex\PropertySheetHandlers\NWCPage]
@="{771a9da0-731a-11ce-993c-00aa004adb6c}"

To register the property sheet handler for all file types, as I did in the PROPEXT sample, substitute an asterisk (*) for the two instances of NWCFile in the preceding code.

You can also register multiple property sheet handlers for a file type. In this case, the order of the subkey names in the PropertySheetHandlers key determines the order of the additional property sheet pages. You can use a maximum of 24 (MAXPROPPAGES) property sheet pages.