Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parenting / Handle Issues #34

Closed
mrAndrewLove opened this issue Feb 25, 2023 · 2 comments
Closed

Parenting / Handle Issues #34

mrAndrewLove opened this issue Feb 25, 2023 · 2 comments

Comments

@mrAndrewLove
Copy link

I'm working on a Delphi legacy project that's in Delphi 2005. We want to move to web which would work much better than the client server application we're currently only. Long story short, we're wanting to create a form with an embedded browser that we can use as were replace different parts of the application. So I am not sure if this issue is specific to Delphi 2005 or not.

If I put a TWVBrowser on a form and hook it up to a TWVWindowParent on a Form. I do all the initialization etc. Anyhow I'm able to pull up web pages no problem.

The problem comes with ShowModal. Ideally I start the navigation then call show modal so there is a little less evident delay loading the page. If I use Form.Show this all works great, however when I use ShowModal which I often will need to do, The handles are all released and new handles are issued. The actual browsers parent becomes invalid. I've looked for a way to reassign the parent but haven't had much luck. Is there a way to reassign the parent in the event that the handle for the TWVWindowParent is release and renewed? Let me know if you want a demo project.

@salvadordf
Copy link
Owner

I haven't tried that but it seems to be supported by WebView2.

I guess that you can call SetParent with TWVBrowserBase.Widget0CompHWND as the first parameter.

In any case, Chromium creates some controls to show the web contents that are on top of everything else. I don't know if ShowModal can interfere with that but it's probably not necessary.

The first navigation is always a little slower because the browser has to initialize and sometimes it has to download the whole web page.

Please, use our forums for more questions :
https://www.briskbard.com/forum/

@salvadordf
Copy link
Owner

This issue is similar to #13.
#13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants