ShellPlus Customer login
Shell+ components
    Customer's area
    Flash Demo
Developer Tools
    Shell Reset Tool
Shell+ Tutorial
    Namespace Extensions
    ShortCut menu
    Property Sheet
    Icon Handler
    InfoTip Handler
    Copy Hook
    Balloon TrayIcon
    Control Panel
    Shortcut Files
    Drag&Drop Menu
    Shell Change Notify
Powered by Shell+
    Romeo Burner
    Articles Index
    Press Releases
    Buy now
    Resellers network
    Resellers wanted
    Contact directly
    Customer's area
    Shell+ Developers

Embarcader Technology Partner

Property Sheet Example

    When user right clicks the file or folder and then clicks the Properties menu item the Properties dialog appears. If you need you can add your own pages to this dialog. This example shows how to do it.

    The PropertySheet handler is an ActiveX library like all other Shell Extensions. The first step to be done is to create a new ActiveX Library. Create it with the following sequence of operations: open the Repository dialog using File | New | Other... menu, then select the ActiveX tab and click the ActiveX Library icon.

Creation of new ActiveX Library
Fig. 1. New ActiveX Library creation.

    Save the created project.

    The next step is to add the instance of TSxDataModule to the project. Every Shell+ component should be placed on SxDataModule 1. This special descendant of TDataModule supplies several internal methods that allow Shell+ components to safely operates in multiple Shell threads and automates their registration and initialization. Note that you can place several Shell+ components onto the same SxDataModule as well as you can add multiple TSxDataModule instances to your project. It is easy to add new SxDataModule to the project - just click corresponding icon in the Repository:

Creation of new SxDataModule
Fig. 2. How to create new SxDataModule instance.

    You can save your project now.

    The next step is to add the PropertySheet component to the SxDataModule. This component controls the creation of property sheet tabs. To use it simply place it on the SxDataModule and configure its properties.

    Table below shows essential properties of the TSxPropSheetExt component.


GUID. As well as other CLSID properties it is generated automatically when you place component on SxDataModule.


Any text that describes your extension.


Short name of the extension, MyPropertySheet for example.


As well as other Shell Extensions the property sheet should be associated with a file type. This example uses the "txtfile" file type which includes text files such as txt, ini, log and some other. Use the Object Inspector's lookup or enter this property manually.


Delphi's name of the component, nothing special


It is a key property of the TSxPropSheetExt component. It contains the description of forms to be added to the Properties dialog. It is these pages will be shown when user right clicks the file and then selects the Properties menu item. Sure these additional pages will be shown if the file type matches that specified in the FileType property. The editor of PropertySheets will be considered below.

Table 1. TSxPropSheetExt properties.

    Set component properties as shown below to continue:

TSxPropSheetExt properties
Fig 3. TSxPropSheetExt properties

    Now add the property page form. This form will be shown as a part of file's properties dialog. Open the Repository dialog with File | New | Other... and select the Shell Extensions page:

New Property Sheet Creation
Fig. 4. Property Sheet creation.

    Click the Property Sheet Form icon and the new PropertySheet form will be created. You can add VCL controls to it now or you can do it later. There is one more step to be done: the form should be attached to the PropertySheet component that was created earlier. This component has a PropertySheets property. Edit it. It looks like shown below:

Add New Property Sheet Example
Fig. 5. PropertySheets editor.

    Use the Add button to show the list of all available property sheet forms. Currently there should be only one because you've added one form only. Select it and it will be added to the list of property sheets. Press خت to save changes.

    Save the project and compile it - it is ready now! As well as any other ActiveX library the Shell+ project requires registration. You can register it in several ways:

  • from command prompt using MS regsvr32 utility: regsvr32.exe Project1.dll
  • from command prompt using Borland's tregsvr utility: tregsvr Project1.dll

To know more about shell extension installation please follow the link.

Now the example is ready for tests. Create an empty text document on the desktop or in any folder and right click it. Then select properties menu item - it is the last item in context menu. The property dialog will appear and this dialog will have one more additional tab with "Shell Plus" caption. It is this caption was entered in the Caption property for the Property Sheet form earlier. Click this tab and you will see the form you've designed:

New File Property Sheet Example

    Don't forget to uninstall the example when all tests are finished. Note that it is an example only and it will show its confirmation window until you will not unregister it. As well as installation the uninstallation can be done in many ways:

  • from command prompt using MS regsvr32 utility: regsvr32.exe /u Project1.dll
  • from command prompt using Borland's tregsvr utility: tregsvr -u Project1.dll

The detailed information about extension uninstallation is available here.

1. The only exception is the TSxTrayIcon component that does not need to be placed on SxDataModule instance.

    Use links below to download source codes of this example as well as binary files:

Delphi XE2 (x64)
Delphi XE2
Delphi XE
Delphi 2010
Delphi 2009
Delphi 2007
Delphi 2006
Delphi 2005
Delphi 7
Delphi 6


Components | Download | Purchase | Support | About Us
Copyright © 2012 ALDYN Software. All rights reserved.
Copyright © 2001 - 2011 Shell+ Development Group. All rights reserved.