Propertysheet Handler Appwizard | CodeGuru

Propertysheet Handler Appwizard

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 […]

Written By
CodeGuru Staff
CodeGuru Staff
Feb 1, 1999
2 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

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",
		"ThreadingModel");
	...
}

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

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.