Page 1 of 1

about Chromium1RenderCompMsg

Posted: Mon Jun 29, 2020 3:05 pm
by coater
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!

Re: about Chromium1RenderCompMsg

Posted: Tue Jun 30, 2020 7:08 am
by salvadordf
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.

Re: about Chromium1RenderCompMsg

Posted: Thu Jul 02, 2020 4:46 am
by coater
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++)

Re: about Chromium1RenderCompMsg

Posted: Thu Jul 02, 2020 7:27 am
by salvadordf
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.

Re: about Chromium1RenderCompMsg

Posted: Thu Jul 02, 2020 2:57 pm
by coater
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 ) );

Re: about Chromium1RenderCompMsg

Posted: Fri Jul 03, 2020 8:00 am
by salvadordf
I've never done that with a browser but I would try to do what Chromium expects us to do to avoid crashes.

Re: about Chromium1RenderCompMsg

Posted: Fri Jul 03, 2020 10:04 pm
by coater
:D Thank you!