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.

How to get handle select

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

Re: How to get handle select

Post by salvadordf »

I'm sorry but I don't understand the question.

Could you please elaborate more of what kind of handle you seek?
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to get handle select

Post by salvadordf »

I still don't understand but if your problem is that you are not seeing the SELECT items then check these posible causes :
  • In a normal browser you need to call TChromium.NotifyMoveOrResizeStarted when the form receives WM_MOVE or WM_MOVING. If you have multiple forms, intercept those messages with a TApplicationEvents component just to be sure. The SimpleBrowser2 demo has all this code.
  • In a browser in OSR mode (off-screen mode) you need to use the TChromium.OnPopupShow and TChromium.OnPopupSize events. Then draw the SELECT items in TChromium.OnPaint. The SimpleOSRBrowser demo has all this code.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to get handle select

Post by salvadordf »

CEF3 captures many Windows messages and it only triggers some events in some occasions.

If you need to receive those messages there are 2 solutions :
  • Use the TChromium.OnRenderCompMsg event to filter all messages : There is a known bug with this event and it will only work in the first web page you load. If you need to capture messages all the time use TChromium.RenderHandle with SetWindowLongPtr and a custom procedure to handle the messages.
  • Use TChromium in OSR mode. Take a look at the SimpleOSRBrowser demo. This demo shows a browser in off-screen rendering mode that allows you to receive all messages and VCL events but it's more complicated to implement.
User avatar
salvadordf
Posts: 4057
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: How to get handle select

Post by salvadordf »

I forgot that those messages can also be intercepted using a "External Message Pump".

Open the SimpleExternalPumpBrowser demo and add a TApplicationEvents and a TStatusBar with 1 panel.

Set the TApplicationEvents.OnMessage event with this code :

Code: Select all

procedure TSimpleExternalPumpBrowserFrm.ApplicationEvents1Message(var Msg: tagMSG; var Handled: Boolean);
begin
  case Msg.message of
    WM_KEYDOWN : StatusBar1.Panels[0].Text := 'WM_KEYDOWN';
    WM_KEYUP   : StatusBar1.Panels[0].Text := '';
  end;
end;
The same code works in OSR mode too with the SimpleOSRBrowser demo.
Post Reply