Registering Sample Property Handler

769 views Asked by At

So I built the RecipePropertyHandler from the Windows 7 SDK samples, ran regsvr32, and registered my PROPDESC file. This gives me the ability to edit a custom property named Difficulty on files of type .recipe, with a three-state dropdown box in the Details Pane, and also gives me the option for adding that property as a column in Explorer details view.

So far, so good. However, I'm trying to follow instructions from this MSDN thread, and I'm seeing some odd things.

First, none of the three registry entries they mention are showing up for me. Specifically:

  1. HKLM\Software\Microsoft\Windows\CurrentVersion\PropertySystem\PropertySchema\
  2. HKLM\Software\Microsoft\Windows\CurrentVersion\PropertySystem\PropertyHandlers.recipe
  3. HKLM\Software\Classes\CLSID{50D9450f-2a80-4f08-93b9-2eb526477d1a} [Actually this is from the Vista SDK, and it looks like the CLSID has changed, but the new one isn't in the registry either.]

They mention a .reg file on the other thread, but I don't think it works that way anymore. For what it's worth, I do see an entry under HKEY_CLASSES_ROOT\.recipe. I'm also able to see the installed property using the prop.exe utility like so:

C:\tools>prop.exe schema describe Microsoft.SampleRecipe.Difficulty
Microsoft.SampleRecipe.Difficulty
----------------------------------
Property Key:          {1794C9FE-74A9-497F-9C69-B31F03CE7EF9} 100
Canonical Name:        Microsoft.SampleRecipe.Difficulty
Property Type:         VT_LPWSTR
Display Name:          Recipe difficulty
Edit Invitation:       Specify recipe difficulty
Type Flags:            PDTF_CANGROUPBY | PDTF_CANSTACKBY | PDTF_ISVIEWABLE | PDTF_ISQUERYABLE
View Flags:
Default Column Width:  20
Display Type:          PDDT_ENUMERATED
Column State:          SHCOLSTATE_TYPE_STR
Grouping Range:        PDGR_ENUMERATED
Relative Desc. Type:   PDRDT_GENERAL
Sort Description:      PDSD_A_Z
Sort Desc. Labels:     A on top/Z on top
Aggregation Type:      PDAT_DEFAULT
Condition Type:        PDCOT_STRING
Condition Operation:   COP_WORD_EQUAL
Enumerated Types:      4
  0 PET_DISCRETEVALUE: Easy            VT_LPWSTR/[Easy]
  1 PET_DISCRETEVALUE: Medium          VT_LPWSTR/[Medium]
  2 PET_DISCRETEVALUE: Hard            VT_LPWSTR/[Hard]
  3 PET_DISCRETEVALUE: Really, Really Hard VT_LPWSTR/[ReallyReallyHard]
Search Info Flags:     PDSIF_ISCOLUMN | PDSIF_ISCOLUMNSPARSE
Column Index Type:     PDCIT_ONDISK
Projection String      Microsoft.SampleRecipe.Difficulty
Max Size:              512

Anyway, the main question is, should I not be able to query this property using either its canonical name or mneumonic name in the Windows Explorer Search UI? That doesn't seem to work for me, and it's not clear from the other thread if it's even supported. It may be the case that Vista and Windows 7 store this information in different places, though.

However, I did notice at least one non-custom property supported using the Advanaced Search Query syntax, namely Microsoft.IE.VisitCount as defined in ie9props.propdesc. So I think there must be a way to do this. What I'm looking for is blue text in the explorer search bar when I type propertyname:value using Advanced Query Syntax. I figure if they support custom edit UI in the Details pane, surely if the property is queryable it will give me a little search filter in the Explorer UI.

1

There are 1 answers

0
Jay Carlton On BEST ANSWER

Yes, it works. I'm not completely sure what did it, but now I've got it working on my machine at least. I can use either my canonical name or mnemonics alias and when I hit the colon character, it turns blue in the Explorer search bar.

The registry locations mentioned in the older thread aren't up-to-date. See https://msdn.microsoft.com/en-us/library/windows/desktop/bb266532(v=vs.85).aspx#prophandlers__installation for the right values as of Windows 7.