I am currently making my custom web browser application using C# (using .net 2012 visual studio). I make use of the webBrowser component which I can found in the toolbox. When running my application, and right click on the webbrowser component, I got the default context menu (that come with the Internet explorer).
Goal: My aim is to customize this default context menu. Customize here means i still want the default context menu, but wanna remove/disable/add
options to this default context menu.
I have implemented to make use of IDocHostUIHandler
interfaces , to catch the event where the context menu is about to be shown.
Here is the snippet of code :
IDocHostUIHandler.ShowContextMenu(uint dwID, ref tagPOINT ppt, object pcmdtReserved, object pdispReserved)
Question: I am not clear upon how to implement this scenery. throw new ComException("", OK)
doesn't even return the default context menu. I have some sample in C++ but unable to replicate the same in c#. Microsoft help file did have codes for modifying existing default context menu ,such as removing the view source option from the context menu, but the code is in C++!!!!!! Anyone can help me on this.
Thanks you.