Re: Creating a general (*) context menu shell item?



I've done this before ... after a while it's pretty easy.

When you write you Context Menu handler, you request from the system a
unique CLSID. There is a freeware progam from MS that will provide this.
Search for CLSID generator.

Then when you add the Contenxt Menu handler to
'*'/shellex/ContextMenuHandlers, you add a unique name where it's default
value is that unique CLSID.

You must provide DLLRegister handler in your code as well as DLLUnregister
handler. This add/remove the entry from the registry.

Then each time a file is right-clicked, all '*' ContextMenuHandlers are
queried, passing a Yes/No back to the caller, and if Yes, the menu item name
is added to the list. Then the extension is checked for a
shellex/ContextMenuHandlers items, and handled the same way as '*'
ContextMenuHandlers items.

<JShrager@xxxxxxxxx> wrote in message
news:1159627330.088315.251250@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I want to create my own shell-based shortcut menu item that comes up on
any file. This MSDN document:


http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/programmersguide/shell_basics/shell_basics_extending/extending.asp

explains how to do this for a given file type. I've tried this and it
works, so I know that my .exe is right, and that I can hack this
correctly for a given (made up) file type (.foo)

This document:

http://windowssdk.msdn.microsoft.com/en-us/library/ms649567.aspx#registering

Explains how to create a general context handler, and how to hook it
into the context menu under the * (all types) type in
HKEY_CLASSES_ROOT.

BUT...

I can't find anything that tells you how to hook one's own shell-type
(.exe-type) context handler under * (all types), and I haven't been
able to figure it out by example (because all the default ones are
registered types!)

For example, the 1st doc above tells you to change the Default entry
for .foo in hkey_classes_root to the name of my special handler. And
that works... for a specific file type (.foo), but I obviously do NOT
want to change the Default key value for the * type!

So, how can I add a shell-type context menu hander for * (all types)?

Thanks in advance!



.



Relevant Pages

  • Re: Windows XP hangs when I right click
    ... Windows displays the context menu. ... * When you click "Play All" in the Music or Videos folder Common Tasks, ... These problems are caused by a poorly coded context menu handler. ... Using ShellExView to determine the Context-menu handler causing the ...
    (microsoft.public.windowsxp.general)
  • Re: Signal delivery order
    ... the context argument is wrong. ... which shows that sigsegv_handler also has incorrect eip in the ... The real life sigsegv handler that's been failing does ... the first instruction of the signal handler can't cause the fault). ...
    (Linux-Kernel)
  • Re: Windows Explorer crashes on launch and more, though not for al
    ... [[These problems are caused by a bad context menu handler. ... > uninstalling the imageconverter, and lo and behold... ... > somewhat disconcerting) I thank you both for your help and my wife thanks ...
    (microsoft.public.windowsxp.perform_maintain)
  • Re: Dynamic ToolStripMenuItem + No Event being triggered
    ... We use a standard ContextMenuStrip control along with a subclassed ... ToolbarMenuItem control that carries some application specific information ... associated ItemClicked Handler. ... handler for the new context menu and that handler works fine for each of the ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Treeview Context Menu
    ... From the tree node, you can traverse up the node path to ... context menu services. ... Now, still in the mouse down event handler, store in a private instance ...
    (microsoft.public.vsnet.general)