ShellPlus Customer login
ShellPlus
Shell+ components
    Home
    News
    Overview
    Download
    Examples
    Customer's area
    Flash Demo
 
Developer Tools
    Shell Reset Tool
 
Shell+ Tutorial
    Namespace Extensions
    ShortCut menu
    Property Sheet
    Icon Handler
    Thumbnails
    InfoTip Handler
    Copy Hook
    Balloon TrayIcon
    Control Panel
    Shortcut Files
    Drag&Drop Menu
    Shell Change Notify
 
 
Documents
    Articles Index
    Press Releases
 
Purchase
    Buy now
    Resellers network
    Resellers wanted
 
Support
    Contact directly
    Customer's area
 
About/Contacts
    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.

CLSID

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

Description

Any text that describes your extension.

ExtensionName

Short name of the extension, MyPropertySheet for example.

FileType

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.

Name

Delphi's name of the component, nothing special

PropertySheets

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 10.1 Berlin (x64)
PropertySheet-D24X64.zip
1.10Mb
3.15.296.396
11.09.2016
Delphi 10.1 Berlin
PropertySheet-D24.zip
895.56Kb
3.15.296.396
11.09.2016
Delphi 10 Seattle (x64)
PropertySheet-D23X64.zip
1.10Mb
3.15.296.396
11.09.2016
Delphi 10 Seattle
PropertySheet-D23.zip
887.90Kb
3.15.296.396
11.09.2016
Delphi XE8 (x64)
PropertySheet-D22X64.zip
1.10Mb
3.12.289.357
15.05.2015
Delphi XE8
PropertySheet-D22.zip
885.82Kb
3.12.289.357
15.05.2015
Delphi XE7 (x64)
PropertySheet-D21X64.zip
1.10Mb
3.11.289.357
19.09.2014
Delphi XE7
PropertySheet-D21.zip
94.37Kb
3.11.289.357
19.09.2014
Delphi XE6 (x64)
PropertySheet-D20X64.zip
1.11Mb
3.10.287.331
16.09.2014
Delphi XE6
PropertySheet-D20.zip
94.36Kb
3.10.287.331
16.09.2014
Delphi XE5 (x64)
PropertySheet-D19X64.zip
1.06Mb
3.10.287.331
16.03.2014
Delphi XE5
PropertySheet-D19.zip
94.06Kb
3.10.287.331
16.03.2014
Delphi XE4 (x64)
PropertySheet-D18X64.zip
1.06Mb
3.10.287.331
16.03.2014
Delphi XE4
PropertySheet-D18.zip
93.97Kb
3.10.287.331
16.03.2014
Delphi XE3 (x64)
PropertySheet-D17X64.zip
1.04Mb
3.10.287.331
16.03.2014
Delphi XE3
PropertySheet-D17.zip
93.94Kb
3.10.287.331
16.03.2014
Delphi XE2 (x64)
PropertySheet-D16X64.zip
793.71Kb
3.10.287.331
16.03.2014
Delphi XE2
PropertySheet-D16.zip
93.82Kb
3.10.287.331
16.03.2014
Delphi XE
PropertySheet-D15.zip
89.37Kb
3.10.287.331
16.03.2014
Delphi 2010
PropertySheet-D14.zip
89.40Kb
3.10.287.331
16.03.2014
Delphi 2009
PropertySheet-D12.zip
57.03Kb
3.10.287.331
16.03.2014
Delphi 2007
PropertySheet-D11.zip
56.19Kb
3.10.287.331
16.03.2014
Delphi 2006
PropertySheet-D10.zip
56.25Kb
3.10.287.331
16.03.2014
Delphi 2005
PropertySheet-D9.zip
57.11Kb
3.10.287.331
16.03.2014
Delphi 7
PropertySheet-D7.zip
268.14Kb
3.12.289.357
16.05.2015
Delphi 6
PropertySheet-D6.zip
55.85Kb
3.8.287.331
09.05.2012

  Top


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