What does a property handler accomplish?

A property handler is the piece of code that enables you to see the properties about your files as in the picture below.  Don't worry about the ambiguity in this sentence; I will be much more specific concerning what component does what in later posts.

Here I've created three .book files.  This is a file type I made up last weekend, so clearly Windows cannot know how to figure out all the data on the screen above without help.  That is where a property handler comes in.  It knows about the properties that apply to each .book file and helps Windows to display this information.

In addition to displaying properties, property handlers let users edit them within the standard Windows user interface:

Property handlers also let users search for files based on the property values.  I can search for "Haunting" and Windows will show "Blindness" in the result set.  And all this can happen from within the standard Windows user interface.

So, in summary, property handlers help your file types fit better into the Windows search and organize experience.  By exposing properties directly in the Windows UI, your users can seamlessly interact with your files without having to open them in applications all the time.  When they have property handlers, your file types feel less bolted onto Windows.

-Ben Karas

Comments (8)

  1. Thriol says:

    I got the impression that there was a built in property handler for OLE Compund Documents. We have written programs that use this file format and that works well in Win2k/XP, but in Vista we can’t see the properties in the "preview bar" nor among the property sheets.

    In Win2K/XP the OS obviously found out by itself that this type of file had an OLE property store, but in Vista it does not.

    (It used to work in Vista Beta 2)

    For an exampel of what it looks like:


    You can see the same problem with other files that use OLE Compund Documents, such as Visio (have not tried Visio 2007 though).

  2. benkaras says:

    There is a built-in property handler for OLE Compound Documents, but it must be specifically registered for your file type.  Set HKLMSoftwareMicrosoftWindowsCurrentVersionPropertySystemPropertyHandlers.myfile = {97e467b4-98c6-4f19-9588-161b7773d6f6}

    In my opinion, XP was too aggressive in the way it handled properties.  It assumed everything was an OLE Compound Document, or failing that, would store data in NTFS secondary streams.  This works great for setting properties on arbitrary types, but it leads to a whole slew of other bugs, including several where a user’s data is lost.

    Vista avoids this assumption.  Instead, property handlers are explicitely registered and are assumed to provide a stronger guarantee that if they are storing properties, they are storing them properly in the file itself.

  3. Thriol says:


    Adding our extension under PropertyHandlers and the provider {97e467b4-98c6-4f19-9588-161b7773d6f6} gave us the thumbnail preview back. Nice. 🙂

    However, we still get no properties in the "preview pane" nor any propery sheet as we did in XP. 🙁

    Are there any other registrations we need to do in order for the properties to work on Vista as they did in XP?

    (BTW, is this documented anywhere? I cannot find any mention of the CLSID in MSDN Lib.)

  4. benkaras says:

    The list of properties to show in the preview pane is determined by a "proplist" in the registry filed under your filetype’s progid.  If the proplist isn’t found, the system will fall back to a number of places, but usually settles on HKCR*.  Take a look at PreviewDetails and FullDetails.  Follow that format to specify a fully list of properties that you want to see for your file type.  I’ll be covering the details later in this series.

    The CLSID is not mentioned in the documentation at the moment, but it’s pretty easy to find.  I just opened regedit and looked for the property handler for .doc files.  Since you’re also using OLE Compound Documents, the handler works for you too.  

    I’m rather impressed that this even retrieved a thumbnail for you!  I was under the impression that the thumbnail provider is separate component.  But I guess they interact somehow.

  5. Thriol says:


    Now I can get the properties in both the preview pane and property sheet to work. Great!

    The thumbnail that we provide as an EMF scales beautifully as you move the slider of the View menu.

    The InfoTip also works fine, but I did not get the TileInfo to work. What is the ExtendedTileInfo used for?

  6. benkaras says:

    TileInfo seems to require an explorer restart.  ExtendedTileInfo is not used.

  7. Thriol says:

    A restart made the TileInfo work (the other settings did not require a restart)

    Now it all looks very nice.

  8. Knowing what you are trying to accomplish is the first step to using the property system. Property handlers

Skip to main content