如何将上下文菜单选项添加到注册的扩展名?

时间:2015-10-06 11:49:24

标签: windows winapi registry explorer

我通过以这种方式写入注册表,为我自己的扩展程序的上下文菜单添加了一个自定义菜单选项:

Key = HKEY_CURRENT_USER\Software\Classes\.mown
Value = MyOWN

Key = HKEY_CURRENT_USER\Software\Classes\MyOWN
Value = My Own Extension

Key = HKEY_CURRENT_USER\Software\Classes\MyOWN\DefaultIcon
Value = C:\Project1.exe

Key = HKEY_CURRENT_USER\Software\Classes\MyOWN\shell\open\command
Value = C:\Project1.exe "%1"

这很好用。 现在我添加自定义菜单选项:

Key = HKEY_CURRENT_USER\Software\Classes\MyOWN\shell\hello
Value = &Hello

Key = HKEY_CURRENT_USER\Software\Classes\MyOWN\shell\hello\command
Value = C:\Project1.exe "%1"

它也有效。 但是当我想将自定义选项(hello)添加到不属于我的扩展时,它就不起作用了:

HKEY_CURRENT_USER\Software\Classes\.txtTxtFile,所以我这样做:

Key = HKEY_CURRENT_USER\Software\Classes\TxtFile\shell\hello
Value = &Hello

Key = HKEY_CURRENT_USER\Software\Classes\TxtFile\shell\hello\command
Value = C:\Project1.exe "%1"

0 个答案:

没有答案