about Chromium1RenderCompMsg

Post Reply
coater
Posts: 105
Joined: Sat Sep 29, 2018 1:51 pm

about Chromium1RenderCompMsg

Post by coater » Mon Jun 29, 2020 3:05 pm

1.where to find some introduction to Chromium1RenderCompMsg? Thank you!

2. How to rightly operate new window in the Chromium1BeforePopup procedure.
sometimes, only using targetUrl is not enough to open new window using self defined form.

Thank you very much!

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

Re: about Chromium1RenderCompMsg

Post by salvadordf » Tue Jun 30, 2020 7:08 am

coater wrote:
Mon Jun 29, 2020 3:05 pm
1.where to find some introduction to Chromium1RenderCompMsg? Thank you!
That event was added to intercept Windows messages sent to the browser. The MiniBrowser demo uses it to get the mouse coordinates.
coater wrote:
Mon Jun 29, 2020 3:05 pm
2. How to rightly operate new window in the Chromium1BeforePopup procedure.
sometimes, only using targetUrl is not enough to open new window using self defined form.
The PopupBrowser and PopupBrowser2 demos show how to create popup windows using that event in OSR mode and normal mode respectively.
Read the code comments for more details.

coater
Posts: 105
Joined: Sat Sep 29, 2018 1:51 pm

Re: about Chromium1RenderCompMsg

Post by coater » Thu Jul 02, 2020 4:46 am

Thank you for your help!

Is Chromium1AfterCreated procedure use a different thread?

If I create a tabsheet in this procedure I found that its thread ID is different from form. (use microsoft spy++)

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

Re: about Chromium1RenderCompMsg

Post by salvadordf » Thu Jul 02, 2020 7:27 am

In normal circumstances, most of the TChromium and GlobalCEFApp events are executed in CEF threads, different than the main application thread.

I simplified the code in the demos to make them a little easier to understand but you should never modify, create or destroy any VCL or FMX control inside those events.

coater
Posts: 105
Joined: Sat Sep 29, 2018 1:51 pm

Re: about Chromium1RenderCompMsg

Post by coater » Thu Jul 02, 2020 2:57 pm

Thank you!

Can browser be used as the follows in the Chromium1BeforePopup procedure ?
SendMessage(Handle, MINIBROWSER_DOCKWIN_MESSAGE, 1,Integer(@browser) );
or a record contains browser?
SendMessage(Handle, MINIBROWSER_DOCKWIN_MESSAGE, 1,Integer(@arecord ) );

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

Re: about Chromium1RenderCompMsg

Post by salvadordf » Fri Jul 03, 2020 8:00 am

I've never done that with a browser but I would try to do what Chromium expects us to do to avoid crashes.

coater
Posts: 105
Joined: Sat Sep 29, 2018 1:51 pm

Re: about Chromium1RenderCompMsg

Post by coater » Fri Jul 03, 2020 10:04 pm

:D Thank you!

Post Reply