Antwise community forums
Getting hwnd of Control - Printable Version

+- Antwise community forums (https://forums.antwise.com)
+-- Forum: Antview (https://forums.antwise.com/forumdisplay.php?fid=11)
+--- Forum: Antview for Windows (https://forums.antwise.com/forumdisplay.php?fid=12)
+--- Thread: Getting hwnd of Control (/showthread.php?tid=121)



Getting hwnd of Control - maddire - 2022-06-21

Is it possible to get the hwnd of the Edge Browser Control?


RE: Getting hwnd of Control - wila - 2022-06-21

Hi,

Not at the moment. At least there's no officially supported way to do that.

Out of curiosity, can you tell me why you want to have the window handle to the browser control?

FWIW, I opened a ticket on your behalf to look into this.
--
Wil


RE: Getting hwnd of Control - maddire - 2022-06-21

I was trying to capture a screenshot of the control and needed it’s hwnd. I did try winspy to get its hwnd but it produced a blank image. Must be limitations of edge itself as i know capturing a canvas image of a https video is near impossible.


RE: Getting hwnd of Control - wila - 2022-06-22

(2022-06-21, 19:06:41)maddire Wrote: I was trying to capture a screenshot of the control and needed it’s hwnd. I did try winspy to get its hwnd but it produced a blank image. Must be limitations of edge itself as i know capturing a canvas image of a https video is near impossible.

One way that at least seems to give some results is to print to Pdf.
eg. I added a button and then called this:
Code:
Private Sub PrintCurrentDocument()
  Dim FilePath As String
  Dim Settings As String
 
  FilePath = "" ' Not specifying a path+filename will popup a file save as dialog
  Settings = "" ' JSON serialized string with options for settings
  ' We're going to add the following JSON:
  ' { "displayHeaderFooter" : true,
  '   "headerTitle" : "AntView PrintToPdf Demo",
  '   "printBackground" : true,
  '   "scale" : 0.5
  ' }
  Settings = "{"
  Settings = Settings & " ""displayHeaderFooter"": true, "
  Settings = Settings & " ""headerTitle"": ""AntView PrintToPdf Demo"", "
  Settings = Settings & " ""printBackground"": true, "
  Settings = Settings & " ""scale"": 0.5 "
  Settings = Settings & "}"
  EdgeWebBrowser.PrintToPdf FilePath, Settings
End Sub
and that did print the contents of the video in the Pdf.

Not sure if that helps you though.
--
Wil