Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Getting hwnd of Control
#1
Is it possible to get the hwnd of the Edge Browser Control?
Reply
#2
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
Reply
#3
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.
Reply
#4
(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
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)