jesus4u Posted July 14, 2003 Posted July 14, 2003 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 Quote Alex Polajenko
Leaders dynamic_sysop Posted July 14, 2003 Leaders Posted July 14, 2003 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 :) Quote
jesus4u Posted July 15, 2003 Author Posted July 15, 2003 Thanks but before I test does it grab the address bar? Quote Alex Polajenko
Leaders dynamic_sysop Posted July 15, 2003 Leaders Posted July 15, 2003 nope , but even microsoft's api spy++ doesnt get the text of that Quote
*Experts* Volte Posted July 15, 2003 *Experts* Posted July 15, 2003 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? Quote
Recommended Posts