Discussion:
Disable Right Click Context Menu in WebBrowser Control
(too old to reply)
luking
2009-07-21 17:05:25 UTC
Permalink
Hi all,

I am creating a simple dialog box with WebBrowser Control, and try to
suppress Context menu when righ clicking. I have done a lot of google
search and got to know have to implement
IDocHostUIHandler::ShowContextMenu interface for that purpose, but
never got a sample of the implementation with a WebBrowser in a dialog
form, Maybe I am in the wrong direction. Can anybody give me a hint?
Here is a pice of code that I have got, I don't know how to
incorporate it with the WebControl I have added in the dialog box.
Thanks you so much!!!

HRESULT IDocHostUIHandler::ShowContextMenu(
   DWORD dwID,
   POINT *ppt,
   IUnknown *pcmdtReserved,
   IDispatch *pdispReserved
  );
Ajay
2009-07-21 20:36:58 UTC
Permalink
Post by luking
Hi all,
I am creating a simple dialog box with WebBrowser Control, and try to
suppress Context menu when righ clicking. I have done a lot of google
search and got to know have to implement
IDocHostUIHandler::ShowContextMenu interface for that purpose, but
never got a sample of the implementation with a WebBrowser in a dialog
form, Maybe I am in the wrong direction. Can anybody give me a hint?
Here is a pice of code that I have got, I don't know how to
incorporate it with the WebControl I have added in the dialog box.
Thanks you so much!!!
HRESULT IDocHostUIHandler::ShowContextMenu(
   DWORD dwID,
   POINT *ppt,
   IUnknown *pcmdtReserved,
   IDispatch *pdispReserved
  );
This shows the steps you need to take for CHTMLView. You need to do
the same for your control:

http://support.microsoft.com/kb/236312

--
Ajay
Ajay
2009-07-21 20:47:00 UTC
Permalink
Post by luking
Hi all,
I am creating a simple dialog box with WebBrowser Control, and try to
suppress Context menu when righ clicking. I have done a lot of google
search and got to know have to implement
IDocHostUIHandler::ShowContextMenu interface for that purpose, but
never got a sample of the implementation with a WebBrowser in a dialog
form, Maybe I am in the wrong direction. Can anybody give me a hint?
Here is a pice of code that I have got, I don't know how to
incorporate it with the WebControl I have added in the dialog box.
Thanks you so much!!!
HRESULT IDocHostUIHandler::ShowContextMenu(
   DWORD dwID,
   POINT *ppt,
   IUnknown *pcmdtReserved,
   IDispatch *pdispReserved
  );
Another way is shown here(probably easier):

http://msdn.microsoft.com/en-us/magazine/cc301445.aspx

--
Ajay
r***@gmail.com
2013-08-16 15:35:11 UTC
Permalink
Post by luking
Hi all,
I am creating a simple dialog box with WebBrowser Control, and try to
suppress Context menu when righ clicking. I have done a lot of google
search and got to know have to implement
IDocHostUIHandler::ShowContextMenu interface for that purpose, but
never got a sample of the implementation with a WebBrowser in a dialog
form, Maybe I am in the wrong direction. Can anybody give me a hint?
Here is a pice of code that I have got, I don't know how to
incorporate it with the WebControl I have added in the dialog box.
Thanks you so much!!!
HRESULT IDocHostUIHandler::ShowContextMenu(
   DWORD dwID,
   POINT *ppt,
   IUnknown *pcmdtReserved,
   IDispatch *pdispReserved
  );
Hi Luking/Ajay,

I have a similar requirement but its in WPF Webbrowser. I have a xaml file which contains webbrowser control. I need to disable the right click context menu but unable to find any help on the internet. If you guys have any idea on the WPF ,either by setting the property in xaml or the implementation in the ViewModel behind the code, really appreciate it.

Regards,
Rahul
R.Wieser
2013-08-17 01:15:05 UTC
Permalink
Another Over 4 years old post ...

Somehow I don't really think its a misconfigured server or (stupid)
google-mail reader at work. Something else (more nefarious) is going on
....

Loading...