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.
If you find these projects useful please consider becoming a sponsor with Patreon, GitHub or Liberapay.

ExternalMessagePump and WM_CLOSE

Post Reply
win568neu
Posts: 29
Joined: Thu May 23, 2024 6:36 am

ExternalMessagePump and WM_CLOSE

Post by win568neu »

Hi Salvador

I tried disabling the MultithreadedMessageLoop and enabling the ExternalMessagePump.
This works so far, but when I exit I have the following problem.

When Chromium.CloseBrowser is called, a WM_CLOSE is sent to the main window. Our application responds to this by displaying a query to exit the window. Is there a way to prevent the WM_CLOSE ?
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: ExternalMessagePump and WM_CLOSE

Post by salvadordf »

Hi,

CEF sends that message automatically to the browser's top-level parent window.

Try adding a TFrame and set TCEFWindowParent as its child as you can see in the TabbedBropwser2 demo.

Download the latest CEF4Delphi version from GitHub to see the latest changes to the TabbedBropwser2 demo.
win568neu
Posts: 29
Joined: Thu May 23, 2024 6:36 am

Re: ExternalMessagePump and WM_CLOSE

Post by win568neu »

Hi Salvador

I have now changed the browser to ALLOY STYLE. Here the WM_CLOSE is not sent when closing, which means my process works.

Just FYI: We already use a TFrame for the TCEFWindowParent . The usage is similar to TabbedBrowser2, but if the ALLOY style is not set, the WM_CLOSE is sent to the main window.
Post Reply