Page 1 of 2

Disable Mouse / Contextmenu

Posted: Fri Mar 10, 2017 3:14 pm
by Det20
Is it possible to disable Contextmenu (right click) or to complete every mouse action like move, click ...?

Re: Disable Mouse / Contextmenu

Posted: Fri Mar 10, 2017 6:11 pm
by salvadordf
According to the CefContextMenuHandler docs :
http://magpcss.org/ceforum/apidocs3/pro ... enuModel>)

You must call model.clear inside the TChromium.OnBeforeContextMenu to disable the context menu.

Re: Disable Mouse / Contextmenu

Posted: Fri Mar 10, 2017 8:58 pm
by Det20
Perfect, thank you. Please let me ask 2 more questions:

- Is it possible to disable every mouse event (move, click ...)? For example, i don't want to see the timeline from youtube if i move the mouse
- Is it possble to dynamically load Chromium Engine only if i need it?

Re: Disable Mouse / Contextmenu

Posted: Sat Mar 11, 2017 8:42 am
by salvadordf
Det20 wrote: Fri Mar 10, 2017 8:58 pm - Is it possible to disable every mouse event (move, click ...)? For example, i don't want to see the timeline from youtube if i move the mouse
There are several tricks you can use :
  • The easiest way : Configure TChromium to be an OSR component. Check the SimpleOSRBrowser and you'll see that you have better control of mouse and keyboard events that way.
  • A transparent panel in front of TCEFWindowParent in non OSR TChromium configuration. I haven't tested this but I remember that it was one of the recommedations for TWebBrowser.
  • Low level mouse hooks https://msdn.microsoft.com/en-us/librar ... s.85).aspx
Det20 wrote: Fri Mar 10, 2017 8:58 pm - Is it possble to dynamically load Chromium Engine only if i need it?
If you mean loading the DLLs only when needed then I'm afraid the answer is no. CEF3 needs to be initialized before the app starts.
If you mean creating the TChromium component at runtime, the answer is yes. BriskBard does that for every tab.

Re: Disable Mouse / Contextmenu

Posted: Sat Mar 11, 2017 10:14 pm
by Det20
Ok, Thank you, i'll check. A last question for today: If i load a page using IE ActiveX, there's no scrollbar. Using Chromium, there is a scrollbar. Is there a property to disable every scrollbar?

BTW: Many many thanks for your good work. Your package is much better and more stable then CEF3! I love it!

Re: Disable Mouse / Contextmenu

Posted: Sun Mar 12, 2017 8:19 am
by salvadordf
Hi :

I'm glad that you like it. :D

Take a look at the list of command line switches here :
http://peter.sh/experiments/chromium-co ... -switches/

There are several switches that could be what you're looking for :
--enable-overlay-scrollbar
--disable-overlay-scrollbar
--hide-scrollbars

You can try them individually in your DPR file like this :
GlobalCEFApp.AddCustomCommandLine('--enable-overlay-scrollbar', '0');
GlobalCEFApp.AddCustomCommandLine('--disable-overlay-scrollbar');
GlobalCEFApp.AddCustomCommandLine('--hide-scrollbars');

They must be called before the GlobalCEFApp.StartMainProcess. Check the minibrowser demo.

Re: Disable Mouse / Contextmenu

Posted: Sun Mar 12, 2017 8:28 am
by Det20
Thank you. Do you know if flash is always supported by chromium with the given package or only if flash is installed by the user on the target system? It would be amazing if it always works, because not many users have installed flash player.

Re: Disable Mouse / Contextmenu

Posted: Sun Mar 12, 2017 8:55 am
by salvadordf
The users must install the PPAPI Flash plugin and GlobalCEFApp.FlashEnabled must be True (Default value).
That's why I had to add an extra FAQ item :
https://www.briskbard.com/index.php?lang=en&faqitem=208

Edit : If you show Youtube videos it could be enough with HTML5. I'm not 100% sure.

Re: Disable Mouse / Contextmenu

Posted: Sun Mar 12, 2017 9:22 am
by Det20
Do you know if it is possible to check, if flash is available for chromium by the application? For example, if not check flash then...

Re: Disable Mouse / Contextmenu

Posted: Sun Mar 12, 2017 10:00 am
by salvadordf
The users can check it here :
http://isflashinstalled.com/
https://www.whatismybrowser.com/detect/ ... -installed
http://www.adobe.com/software/flash/about/

If you need to check it in the code, you could read the list of installed programs in the registry.
http://delphiexamples.com/system/installprog.html