Page 1 of 1

Block Right Click

Posted: Fri Apr 27, 2018 5:54 pm
by alpires2000
Hi guys, existe some way to block the right mouse click to avoid the source and print menu?
Thanks

Re: Block Right Click

Posted: Fri Apr 27, 2018 6:44 pm
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.
  ///

Re: Block Right Click

Posted: Wed May 02, 2018 2:04 pm
by alpires2000
Thanks