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.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

SendMouseWheelEvent does not work

User avatar
salvadordf
Posts: 4572
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: SendMouseWheelEvent does not work

Post by salvadordf »

The PopupBrowser demo shows how to avoid the "System Error Code 5" problem when the browser needs to show a new popup window in OSR mode.

It creates a hidden form that is used in the TChromium.OnBeforePopup event but in your case you should create a hidden tab.
User avatar
salvadordf
Posts: 4572
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: SendMouseWheelEvent does not work

Post by salvadordf »

There's a CEF issue with the TChromium.OnBeforePopup event and new popup windows in OSR mode :
https://github.com/salvadordf/CEF4Delphi/issues/249
https://bitbucket.org/chromiumembedded/ ... n-osr-mode
micmorozov
Posts: 18
Joined: Mon Oct 07, 2019 7:53 am

Re: SendMouseWheelEvent does not work

Post by micmorozov »

My situation is simpler:
I do not create tabs from TChromium.OnBeforePopup event.
I create them as in TabbedBrowser2, only every frame has an OSR browser.
Which is also created dynamically with different context
User avatar
salvadordf
Posts: 4572
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: SendMouseWheelEvent does not work

Post by salvadordf »

Then the solution is much easier.

Check all TChromium events to see if if any VCL control is created, destroyed or modified inside them.
Sometimes the VCL code has a hidden "RecreateWnd" call inside some other harmless looking function that causes all this issues.

Move all code that modifies VCL controls outside TChromium or TCEFApplication events.
micmorozov
Posts: 18
Joined: Mon Oct 07, 2019 7:53 am

Re: SendMouseWheelEvent does not work

Post by micmorozov »

I use version: CEF4Delphi uses CEF 73.1.12 which includes Chromium 73.0.3683.75.

As soon as I change

Code: Select all

TChromium.CreateBrowser(TCEFWindowParent);
to

Code: Select all

TChromium.CreateBrowser(nil)
and use TChromium.OnBeforeClose instead TChromium.OnClose

I receive error system 5
micmorozov
Posts: 18
Joined: Mon Oct 07, 2019 7:53 am

Re: SendMouseWheelEvent does not work

Post by micmorozov »

Found a mistake!

I created tabs with Tchromium before the cef had time to initialize

Sometimes managed to initialize sometimes not
Post Reply