TChromiumwindow behind parent FORM

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

Re: TChromiumwindow behind parent FORM

Post 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);
BBC
Posts: 7
Joined: Tue Feb 27, 2018 11:38 am

Re: TChromiumwindow behind parent FORM

Post 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!
User avatar
salvadordf
Posts: 3046
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: TChromiumwindow behind parent FORM

Post 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.
Post Reply