Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I am trying to get the ClassName of the Opera browser and then read the url from the address bar but I can't seem to get the name of the address bar. What is it? I am using Spy++ and no luck. Other browsers' address bars are typically called "Edit" but not in Opera.

 

Declare Function GetClassName Lib "user32" Alias "GetClassNameA" (ByVal hwnd As Long, ByVal lpClassName As String, ByVal nMaxCount As Long) As Long

Alex Polajenko
  • Leaders
Posted

with your opera browser opened up try this :

   Private Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Integer
   Private Declare Function GetClassName Lib "user32.dll" Alias "GetClassNameA" (ByVal hwnd As Integer, ByVal lpClassName As System.Text.StringBuilder, ByVal nMaxCount As Integer) As Integer


   Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
       Dim x As Integer = FindWindow("OpWindow", vbNullString)
       Dim s As System.Text.StringBuilder = New System.Text.StringBuilder(255)
       GetClassName(x, s, s.Capacity)
       MessageBox.Show("the opera browser's hwnd is: " & x & Chr(13) _
       & "the window name is: " & s.ToString)
   End Sub

:)

  • *Experts*
Posted

It looks like the browser bit of Opera (browser itself, and the toolbar at the top of it with the addressbar etc) is all one class called FRAMES2. Even Spy++ couldn't see that it had child windows.

 

You might be able to enumerate the child windows with VB, but if Spy++ couldn't do it, you may be out of luck. Anyway, why do you need to read the addressbar of Opera?

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...