注册Windows shell命名空间文件夹视图扩展名为特定文件扩展名

时间:2014-03-13 14:10:59

标签: c++ windows registry explorer windows-shell

我有一些用于文件夹视图的Windows命名空间shell扩展。我想用它来与具有特定文件扩展名的文件进行用户交互。这些文件是由我的其他应用程序创建的。

如何在Windows注册表中正确注册。我应该为我的扩展名和扩展名的CLSID或其他东西添加一些文件扩展名的密钥吗?

1 个答案:

答案 0 :(得分:5)

您必须在此注册表位置注册:

[HKEY_CLASSES_ROOT\.yourextension]
@="CLSID\\{Your namespace extension CLSID}"

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}]
@="Test File"

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\CLSID]
@="{Your namespace extension CLSID}"

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\DefaultIcon]
@="yourdll.dll,0"

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\Implemented Categories]

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\Implemented Categories\{00021490-0000-0000-C000-000000000046}]

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\InProcServer32]
@="yourdll.dll"
"ThreadingModel"="Apartment"

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\shell]

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\shell\explore]

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\shell\explore\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,2e,00,65,00,78,00,\
  65,00,20,00,2f,00,65,00,2c,00,2f,00,69,00,64,00,6c,00,69,00,73,00,74,00,2c,\
  00,25,00,49,00,2c,00,25,00,4c,00,00,00

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\shell\explore\ddeexec]
@="[ExploreFolder(\"%l\", %I, %S)]"
"NoActivateHandler"=""

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\shell\explore\ddeexec\application]
@="Folders"

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\shell\explore\ddeexec\ifexec]
@="[]"

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\shell\explore\ddeexec\topic]
@="AppProperties"

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\shell\find]
"SuppressionPolicy"=dword:00000080

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\shell\find\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,2e,00,65,00,78,00,\
  65,00,00,00

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\shell\find\ddeexec]
@="[FindFolder(\"%l\", %I)]"

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\shell\find\ddeexec\application]
@="Folders"

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\shell\find\ddeexec\topic]
@="AppProperties"

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\shell\open]

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\shell\open\command]
@=hex(2):25,00,53,00,79,00,73,00,74,00,65,00,6d,00,52,00,6f,00,6f,00,74,00,25,\
  00,5c,00,45,00,78,00,70,00,6c,00,6f,00,72,00,65,00,72,00,2e,00,65,00,78,00,\
  65,00,20,00,2f,00,69,00,64,00,6c,00,69,00,73,00,74,00,2c,00,25,00,49,00,2c,\
  00,25,00,4c,00,00,00

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\shell\open\ddeexec]
@="[ViewFolder(\"%l\", %I, %S)]"
"NoActivateHandler"=""

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\shell\open\ddeexec\application]
@="Folders"

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\shell\open\ddeexec\ifexec]
@="[]"

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\shell\open\ddeexec\topic]
@="AppProperties"

[HKEY_CLASSES_ROOT\CLSID\{Your namespace extension CLSID}\ShellFolder]
"Attributes"=dword:680001a0

有关可能的属性值,请参阅SFGAO值。

也不要忘记将CLSID添加到Approved shell扩展中。