Hello Salvadordf!
Tell me how can I get the handle of the active window with the class name "Chrome_RenderWidgetHostHWND"?
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.
handle - Chrome_RenderWidgetHostHWND
- salvadordf
- Posts: 4093
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: handle - Chrome_RenderWidgetHostHWND
Hi,
TWVBrowserBase already has the code to find the window called "Chrome_RenderWidgetHostHWND" and all other windows created by WebView2.
TWVBrowserBase has 4 events to intercept the messages sent to those windows :
TWVBrowserBase already has the code to find the window called "Chrome_RenderWidgetHostHWND" and all other windows created by WebView2.
TWVBrowserBase has 4 events to intercept the messages sent to those windows :
- TWVBrowserBase.OnWidget0CompMsg
- TWVBrowserBase.OnWidget1CompMsg
- TWVBrowserBase.OnRenderCompMsg
- TWVBrowserBase.OnD3DWindowCompMsg
- TWVBrowserBase.RenderCompHWND
- TWVBrowserBase.Widget0CompHWND
- TWVBrowserBase.Widget1CompHWND
- TWVBrowserBase.D3DWindowCompHWND
Re: handle - Chrome_RenderWidgetHostHWND
Greate.
Many thanks.
Many thanks.
Re: handle - Chrome_RenderWidgetHostHWND
Why do I get a blank image when trying to take a screenshot using these handles?
- salvadordf
- Posts: 4093
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: handle - Chrome_RenderWidgetHostHWND
Try using the TWVBrowser.CapturePreview instead and implement the TWVBrowser.OnCapturePreviewCompleted event to get the image.
Capturing images using HWNDs usually fails when the hardware acceleration is enabled.
Capturing images using HWNDs usually fails when the hardware acceleration is enabled.
Re: handle - Chrome_RenderWidgetHostHWND
It didn't work:
Screenshot works fine with Edge (Chrome_RenderWidgetHostHWND)
Code: Select all
GlobalWebView2Loader.EnableGPU := false;
Could you provide an example? I can't figure out how to implement it.salvadordf wrote: ↑Wed Aug 23, 2023 1:32 pm Try using the TWVBrowser.CapturePreview instead and implement the TWVBrowser.OnCapturePreviewCompleted event to get the image.
- salvadordf
- Posts: 4093
- Joined: Thu Feb 02, 2017 12:24 pm
- Location: Spain
- Contact:
Re: handle - Chrome_RenderWidgetHostHWND
The MiniBrowser demo has all the code here :Vaytl wrote: ↑Wed Aug 23, 2023 6:46 pmCould you provide an example? I can't figure out how to implement it.salvadordf wrote: ↑Wed Aug 23, 2023 1:32 pm Try using the TWVBrowser.CapturePreview instead and implement the TWVBrowser.OnCapturePreviewCompleted event to get the image.
https://github.com/salvadordf/WebView4Delphi/blob/53325f5db15b71aed8fb0aa903b6e7d51174e94c/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas#L181
https://github.com/salvadordf/WebView4Delphi/blob/53325f5db15b71aed8fb0aa903b6e7d51174e94c/demos/Delphi_VCL/MiniBrowser/uMiniBrowser.pas#L499