Click to See Complete Forum and Search --> : RClick on CWebBrowser2


bhatia
April 14th, 1999, 12:09 PM
I am hosting a webbrowser2 in my MFC based application. I'd like to customize the right click popup menu of IE.

After checking the sample Driller, I implemented CustSite and return S_OK from CCustomControlSite::XDocHostUIHandler::ShowContextMenu.

It does not display the IE menu.

How do I obtain the handle to the associated WebBrowser object ?

I need it to display and manage the popup menu.

TIA.

-Neeraj

storm
June 22nd, 1999, 08:37 PM
Did you ever figure this out? please let me know!

Colin Davies
June 23rd, 1999, 12:23 AM
Hi
Do these help ?
http://support.microsoft.com/support/kb/articles/Q177/2/41.asp

http://msdn.microsoft.com/workshop/browser/Hosting/Hosting.asp#doc_host_UI

Regards
Colin Davies

At the Mount

bhatia
June 23rd, 1999, 09:01 AM
All these articles are good, but they don't tell you everything. I wanted to insert the webbrowser object in a MFC DLL with minimal impact on the calling application.

Finally, I used the DocHostUIHandler method.

I derived a class from IDocHostUIHandler, made it a friend of my view class. Kept a pointer of my view class inside the derived class. Initialized it. When I right-click occurs, I call a function of the my view class.

I hope this helps.

I found that this technique works easily as compared to using CustSite way.


Regards.