Hey all,
I've had to dive down into unmanaged world from .NET recently to
subclass the IE browser window for the purposes of adding menu items.
I've gotten the items added thanks to the Win32 API "InsertMenu" call,
but they don't do anything.
The problem is, I don't own the menu, so I don't process the result
codes that are returned from TrackPopupMenu (or TrackPopupMenuEx). I
don't know if IE uses the IContextMenu mechanism that the Windows
Shell does, but I doubt it. So without having to reimplement the
browser's ShowContextMenu function (which would be a bit of a hack,
most likely), how can I get my menu items to do what I want?
I tried looking for windows messages raised when a menu item is
clicked, but it doesn't look like there are any. I see a
WM_MENUSELECT, and then I see WM_UNINITMENUPOPUP, but nothing to
indicate that the item was actually clicked on.
Is there a (relatively) easy way I can specify a function to be called
when someone clicks on my menu item if I'm not the one calling
TrackPopupMenu?
Thanks,
Nathan