Page 1 of 1

ExternalMessagePump and WM_CLOSE

Posted: Thu Jan 09, 2025 12:54 pm
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 ?

Re: ExternalMessagePump and WM_CLOSE

Posted: Thu Jan 09, 2025 4:46 pm
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.

Re: ExternalMessagePump and WM_CLOSE

Posted: Mon Jan 13, 2025 9:30 am
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.