After reading the article "Creating Shell Extensions with Shell
Instance Objects" written by Raymond Chen, I use the method to create a
context menu. Here is an example
REGEDIT4
[HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers\SuperHidden]
@="{537F6DED-62F4-45f9-B832-F0E86BD0F136}"
[HKEY_CLASSES_ROOT\CLSID\{537F6DED-62F4-45f9-B832-F0E86BD0F136}\InProcServer32]
@=hex(2):25,53,79,73,74,65,6d,52,6f,6f,74,25,5c,73,79,73,74,65,6d,33,32,5c,73,\
68,64,6f,63,76,77,2e,64,6c,6c,00
"ThreadingModel"="Apartment"
[HKEY_CLASSES_ROOT\CLSID\{537F6DED-62F4-45f9-B832-F0E86BD0F136}\Instance]
"CLSID"="{3f454f0e-42ae-4d7c-8ea3-328250d6e272}"
[HKEY_CLASSES_ROOT\CLSID\{537F6DED-62F4-45f9-B832-F0E86BD0F136}\Instance\InitPropertyBag]
"method"="ShellExecute"
"Param1"="D:\\Program Files\\SuperHidden\\SuperHidden.vbs"
"command"="Display/Hidden Files"
"CLSID"="{13709620-C279-11CE-A49E-444553540000}"
It works well. But now I need an other menu for other task, I found it
cannot display two menus if I add similar keys to the registry.
Is it possible to create 2 instance of object or display mutiple menus
in one instance.
Thx
From the single instance you can add many menu items. There's no need
to add further registry settings, just modify the code in your
QueryContextMenu function to insert additional menu items.
Dave
On Jan 26, 3:56 pm, David Lowndes <Dav...@example.invalid> wrote:
> >After reading the article "Creating Shell Extensions with Shell
> >Instance Objects" written by Raymond Chen, I use the method to create a
> >context menu.
> >...
> >It works well. But now I need an other menu for other task, I found it
> >cannot display two menus if I add similar keys to the registry.
>
> >Is it possible to create 2 instance of object or display mutiple menus
> >in one instance.From the single instance you can add many menu items. There's no need
Ah my mistake, I wasn't even aware of those.
Dave
The problem is that the Automation context menu object uses the "open" verb for its menu item. The shell automatically removes menu items with duplicate verbs, which is why your second instance object doesn't appear. And if the "open" verb had already existed in the Directory\Background menu, your first instance object wouldn't have showed up either.
--
Jim Barry, MVP (Windows SDK)
Is there a way to change the verb the object use?
I searched the whole internet and couldn't find anything more about
Shell Instance Object except the article of raymond. can U plz tell how
to fetch the detailed info about something like this. Sometimes I need
internal info about some tech and I found nowhere to get it.
For instance, the value here such as "ShellExecute" "Command" "Param1",
How to get the names of these values and the usage?
Unfortunately not - it's hard coded.
> I searched the whole internet and couldn't find anything more about
> Shell Instance Object except the article of raymond. can U plz tell
> how to fetch the detailed info about something like this. Sometimes I
> need internal info about some tech and I found nowhere to get it.
> For instance, the value here such as "ShellExecute" "Command"
> "Param1", How to get the names of these values and the usage?
Well, the Automation context menu object isn't documented and presumably is only intended for the shell's internal use. How did you discover it - just by trawling the registry?
On 1月27日, 上午12时12分, "Jim Barry" <j...@mvps.org> wrote:
> hayate wrote:
> > Is there a way to change the verb the object use?Unfortunately not - it's hard coded.
>
> > I searched the whole internet and couldn't find anything more about
> > Shell Instance Object except the article of raymond. can U plz tell
> > how to fetch the detailed info about something like this. Sometimes I
> > need internal info about some tech and I found nowhere to get it.
> > For instance, the value here such as "ShellExecute" "Command"
> > "Param1", How to get the names of these values and the usage?Well, the Automation context menu object isn't documented and presumably is only intended for the shell's internal use. How did you discover it - just by trawling the registry?