What I'd love to see is a C# BHO 1) adding a menu item to the default context menu and 2) capturing the event when the user clicks on that item.
I've created a custom UI handler object, and it sinks the ShowContextMenu event fine.
I can load shdoclc.dll, where the default menu is kept. Great.
The problem I'm facing now is that I cannot load the default menu using User32's LoadMenu function. The last error I get is that the function cannot locate the resource I'm trying to load. The signature of the method is as follows:
IntPtr LoadMenu(IntPtr hInstance, string menuName)
In sample code, I can see that you are supposed to use the MAKEINTRESOURCE macro to convert the resource ID (which appears to be a const uint 24641 defined as IDR_BROWSE_CONTEXT_MENU) into a string. If I pass "24641" to LoadMenu I get a resource not found. If I create a uint of value 24641 and convert that to string and pass it in, same dice. What am I missing here
I'm also looking for the last two bits--adding a new menu item to this menu once I have it (or at least a pointer to it), somehow hooking an event handler to this new item (that must sound retarded to c++ developers), and showing this modified context menu to users. TIA.

Example of a BHO doing this in C#, please
Scott_P
Did you succeed in solving this, because I have the same problem.
Regards
andyedw
Same problem here although I did manage to get one step farther.
I changed the second parameter type from string to IntPtr and now I can load the menu.
[DllImport("user32")] private static extern IntPtr LoadMenu(IntPtr hInstance, IntPtr id );
void IDocHostUIHandler.ShowContextMenu(uint dwID, ref MsHtmHstInterop.tagPOINT ppt, object pcmdtReserved, object pdispReserved)
{
System.IntPtr hmod = LoadLibrary("SHDOCLC.DLL");
new IntPtr(24641 );IntPtr ptr =
IntPtr p = LoadMenu( hmod, ptr ); //<== This works.
}I wish there was some way to convert the menu handle to a C# ContextMenu class.
In MFC most of the classes were just wrappers around an hWnd so you could instantiate an object
and set the hWnd to use it.