Propertysheet Handler Appwizard

WEBINAR: On-demand webcast

How to Boost Database Development Productivity on Linux, Docker, and Kubernetes with Microsoft SQL Server 2017 REGISTER >

Property Sheet Wizard is a Visual C++ 4.0 AppWizard (it won't work with 5.0 for some reason...I havn't tested it with 6.0 though) that creates a shell extension DLL that adds another property page to the Properties dialog, as shown on the left. (Right-click on a file and choose Properties to display this dialog). The DLL supports self registration, that is you can register it with regsvr32.

To use this AppWizard, first it needs to be copied to your \BIN\IDE directory (for example mine is C:\MSDEV\BIN\IDE), then it will be displayed in the New Project dialog in Visual C++. Choose it to create a new property sheet file handler.

There are no steps to the AppWizard, it just creates a generic shell extension DLL.

For some reason, the .DEF file does not get added, so you will need to add PROPSHEET.DEF to your project before compiling. Also make sure to use uuidgen to generate a new CLSID for the DLL in Properties.h when developing your own shell extensions.

By default, the AppWizard creates a handler for a folder. Change the parameter to AddSymbol in CProperties::CPropertiesFactory::UpdateRegistry() in Properties.cpp to the alais for the file type:

BOOL CProperties::CPropertiesFactory::UpdateRegistry(BOOL bRegister)
	CRegisterClass reg(m_clsid, "Bitmap.Properties");

	VERIFY(reg.AddSymbol("bmpfile") == 3);   // Zero based... really %4
	reg.AddEntry("CLSID\\%1\\InProcServer32", "Apartment", 
In the example above we are making a handler for bitmaps, assuming the alias for bmp files is "bmpfile". Note that is it not the filenames extension. Look in HKEY_CLASSES_ROOT\. to figure out the alais of a specific filename extension. When developing your own handlers, make sure to change "PropSheet.Properties" to something more approiate.

I did not include an example with this project because it is very easy to make. Just create a new project using the AppWizard, compile and register it. (Register DLLs by running regsvr32 or choosing Register Control from the Tools menu when the project is loaded in Visual C++). Then right-click on any folder on your hard disk and choose Properties. Something similar to this should appear.

This code was originally taken from Visual C++ 4.0 How-To, a very useful book by Scott Stanfield and Ralph Arversen. I wrapped it up into a nice AppWizard and made it generic (it used to display subfolders there sizes of the selected folder).

Download source - 52.3 KB


  • Add data to the PropertySheet tab from a dialog box

    Posted by Legacy on 06/01/2000 12:00am

    Originally posted by: Priya

    Could anyone help me to add a property page to the propertysheet handler and also fill the controls in the new page with the values from my formview application for each file.

    Is this possible??Is there any good books to read from?

    Thank you

  • Unable to compile code generated by wizard under msc v6

    Posted by Legacy on 01/20/2000 12:00am

    Originally posted by: Robert Fernando

    Hi all,
    I managed to recompile the wizard to get it to generate files under v6, but
    when I compile a file generated with the wizard it I get the following error.

    f:\safeboot.40\encrprop\Properties.cpp(172) : error C2664:
    'CreatePropertySheetPageA' : cannot convert parameter 1 from 'struct
    Types pointed to are unrelated; conversion requires
    reinterpret_cast, C-style cast or function-style cast
    Error executing cl.exe.

    This error occurs in the function STDMETHODIMP
    CProperties::XShellPropExt::AddPages (LPFNADDPROPSHEETPAGE lpfnAddPage,
    LPARAM lParam)
    on the line HPROPSHEETPAGE hPSP = CreatePropertySheetPage(&pPage->m_psp);

    Is there a fix for this.

    MSC v6 Enterprise Edition no service packs
    Microsoft Platform SDK for Windows 2000 RC2
    os being used win 98

    Robert Fernando

  • How do you add these property pages to control panels.

    Posted by Legacy on 08/04/1999 12:00am

    Originally posted by: Shaun Ruffell

    I sucessfully used this wizard to build and add property pages to different files. What I would like to do though is add a new page to the Display Control Panel. Everything I have read in the MSDN seems to imply that the property page provider is the same. The only difference for adding pages is that you have to place the GUID of the property page provider under the HKLM\Software\Microsoft\Windows\CurrentVersion\Control Folders\Display\Shellext key. I can duplicate the Plus! page which is added to the Display Control panel, but am unable to add my own.

    Does anyone know how to do this or know where there is a sample of how to add a page to a control panel applet?


  • propsheet wizard

    Posted by Legacy on 02/15/1999 12:00am

    Originally posted by: Den Semenenko

    Works perfectly after recompiling with VC5.
    Just have to add blank *.clw to \templates....

  • Property Sheet Handler AppWizard

    Posted by Legacy on 02/13/1999 12:00am

    Originally posted by: Brian Hart

    I just tried to use the Property Sheet Handler AppWizard with Visual C++ 6.0 and it does not work.

    Just wanted to let the CodeGuru community know, as the developer has mentioned he didn't know whether or not the code works with Visual C++ 6.

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • As all sorts of data becomes available for storage, analysis and retrieval - so called 'Big Data' - there are potentially huge benefits, but equally huge challenges...
  • The agile organization needs knowledge to act on, quickly and effectively. Though many organizations are clamouring for "Big Data", not nearly as many know what to do with it...
  • Cloud-based integration solutions can be confusing. Adding to the confusion are the multiple ways IT departments can deliver such integration...

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date