IE 4.0: IDocHostUIHandler::ShowContextMenu (using)
Posted on 1998-01-01
I'm hosting IE 4.0 as an ActiveX control ("Microsoft Web Browser" is the actual name of the ActiveX control from the SDK)
Anyway, it's pretty cool, and does most of what I want, but I do need to provide my own pop-up context menu. (That thing that pops up when you right click on a link or pic on the web page)
I've used IDocHostUIHandler, and have overridden ShowContextMenu. When the user right-clicks on the link, my overridden ShowContextMenu works fine (It goes to my method, and, because I return S_OK, the browser doesn't display its pop-up) but... I need to find out what the context menu was brought up from (e.g., the link, pic, et al. that the user right-clicked on.)
The code looks like:
HRESULT FAR EXPORT CCustomControlSite::XDocHostUIHandler::ShowContextMenu(
// Display Custom Context menu... How????
return S_OK; // We've shown our own context menu. MSHTML.DLL will no longer try to show its own.
It sort of looks like IDispatch might have some info about what was clicked on, but is always NULL. I COULD use what IUnknown points to, but don't know what the correct object is. (I'm not an expert at COM/ActiveX yet, so may just be missing a simple way to find out what IUnknown points to)
Anyway, if you know how to do this, or can point me in the right direction, it would be VERY helpfull.
(If it's helpfull, I'm basing this off of the IE 4.0 SDK example code "Driller" in \INetSDK\samples\Drill"