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.

Resize not working

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

Re: Resize not working

Post by salvadordf »

The browser needs to know when the parent component has been resized to resize the contents.

The TCEFWindowParent does that overriding the Resize procedure.

You can use a handle from another process to be the browser parent but you will miss several browser functions.
User avatar
salvadordf
Posts: 4564
Joined: Thu Feb 02, 2017 12:24 pm
Location: Spain
Contact:

Re: Resize not working

Post by salvadordf »

I haven't tried that on a different process but I guess you can try to use a similar method to the one used in TCEFWindowParent.UpdateSize.

Call TChromium.WindowHandle to get the browser handle and then use BeginDeferWindowPos, DeferWindowPos and EndDeferWindowPos.

TCEFWindowParent uses GetWindow(Handle, GW_CHILD) instead of TChromium.WindowHandle. Try both if necessary.

This is source for TCEFWindowParent :
https://github.com/salvadordf/CEF4Delph ... Parent.pas
Post Reply