Page 1 of 1

Re: TChromiumwindow behind parent FORM

Posted: Fri Mar 22, 2019 2:27 pm
by salvadordf
Hi,

First of all, sorry for the long delay.

I only have a Delphi Community Edition license and I can't test Delphi 7.

I tried to reproduce this issue in Delphi 10.3 and Lazarus using the toolbox demos but I couldn't get the same results.

CEF also had some focus issues like this one :
https://bitbucket.org/chromiumembedded/ ... ser-window

It was fixed using a WS_EX_NOACTIVATE exstyle :
https://bitbucket.org/chromiumembedded/ ... ?at=master

I'm not sure if this is related to this issue but I would try to modify TChromium.InitializeWindowInfo and call WindowInfoAsChild with the aExStyle parameter :

Code: Select all

WindowInfoAsChild(FWindowInfo, aParentHandle, aParentRect, aWindowName, WS_EX_NOACTIVATE);

Re: TChromiumwindow behind parent FORM

Posted: Sat Aug 01, 2020 4:29 pm
by BBC
SetWindowPos(Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE or SWP_NOMOVE);

WindowInfoAsChild(FWindowInfo, aParentHandle, aParentRect, aWindowName, WS_EX_NOACTIVATE);

TChromium.DefaultWindowInfoExStyle := WS_EX_NOACTIVATE;

Not help me =\

if PostMessage(...WM_LBUTTONDOWN.... Chromium steals focus....

Pls help!

Re: TChromiumwindow behind parent FORM

Posted: Sat Aug 01, 2020 6:14 pm
by salvadordf
I'm sorry but that's a known unreloved issue in CEF.

If those workarounds don't help you then consider using a browser in "Off-screen" mode, also known as OSR mode.

The OSR mode gives you total control of the focus. Try the SimpleOSRBrowser demo.