Disclosure Statement: This site contains affiliate links, which means that I may receive a commission if you make a purchase using these links. As an eBay Partner, I earn from qualifying purchases.

Block Right Click

Post Reply
alpires2000
Posts: 48
Joined: Sat Dec 09, 2017 4:40 pm

Block Right Click

Post by alpires2000 »

Hi guys, existe some way to block the right mouse click to avoid the source and print menu?
Thanks
User avatar
salvadordf
Posts: 4056
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Block Right Click

Post by salvadordf »

Hi,

Use the TChromium.OnBeforeContextMenu event and add this code :

Code: Select all

model.clear;
This is explained here :
http://magpcss.org/ceforum/apidocs3/pro ... ndler.html
http://magpcss.org/ceforum/apidocs3/pro ... Model.html

If you prefer to read the original CEF code, these are the code comments for that event :
https://github.com/chromiumembedded/cef ... ler_capi.h

Code: Select all

  ///
  // Called before a context menu is displayed. |params| provides information
  // about the context menu state. |model| initially contains the default
  // context menu. The |model| can be cleared to show no context menu or
  // modified to show a custom menu. Do not keep references to |params| or
  // |model| outside of this callback.
  ///
alpires2000
Posts: 48
Joined: Sat Dec 09, 2017 4:40 pm

Re: Block Right Click

Post by alpires2000 »

Thanks
Post Reply