注册示例属性处理程序

时间:2015-06-24 18:25:15

标签: windows-search file-properties

所以我从Windows 7 SDK示例中构建了RecipePropertyHandler,运行了regsvr32,并注册了我的PROPDESC文件。这使我能够在类型Difficulty的文件上编辑名为.recipe的自定义属性,并在详细信息窗格中使用三态下拉框,并且还提供了将该属性添加为资源管理器详细信息视图中的列。

到目前为止,这么好。但是,我正在尝试按照this MSDN thread的说明,我看到了一些奇怪的事情。

首先,他们提到的三个注册表项中没有一个出现在我面前。具体做法是:

  1. HKLM \软件\微软\的Windows \ CurrentVersion \ PropertySystem \ PropertySchema \
  2. HKLM \软件\微软\的Windows \ CurrentVersion \ PropertySystem \ PropertyHandlers.recipe
  3. HKLM \ Software \ Classes \ CLSID {50D9450f-2a80-4f08-93b9-2eb526477d1a} [实际上这是来自Vista SDK,看起来CLSID已经改变,但是新的不在注册表中]
  4. 他们在另一个帖子中提到了一个.reg文件,但我认为它不再那样。 对于它的价值,我确实在HKEY_CLASSES_ROOT\.recipe下看到了一个条目。我也可以使用prop.exe实用程序查看已安装的属性,如下所示:

    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
    

    无论如何,主要问题是,我是否应该在Windows资源管理器搜索UI中使用其规范名称或mneumonic名称来查询此属性?这对我来说似乎不起作用,并且从其他线程中可以看出它是否支持。但是,Vista和Windows 7可能会将这些信息存储在不同的地方。

    但是,我确实注意到至少有一个使用Advanaced Search Query语法支持的非自定义属性,即ie9props.propdesc中定义的Microsoft.IE.VisitCount。所以我认为必须有办法做到这一点。当我使用Advanced Query Syntax键入propertyname:value时,我正在寻找的是资源管理器搜索栏中的蓝色文字。我想如果他们在“详细信息”窗格中支持自定义编辑UI,当然如果该属性是可查询的,它将在Explorer UI中为我提供一些搜索过滤器。

1 个答案:

答案 0 :(得分:0)

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.
相关问题