Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Read Web Browser Address Bar?

7 views
Skip to first unread message

duke

unread,
Dec 24, 2009, 5:34:56 PM12/24/09
to
Using VB6 is there someway to write a program that would tell me what
the contents of the address bar of the active window of any web
browser (IE, Firefox etc.)

Thanks in Advance

Duke

mayayana

unread,
Dec 24, 2009, 7:20:31 PM12/24/09
to
Your best bet is probably the DOM. With IE it's
the IE.LocationURL, or document.location.href
or document.url. I'm not familiar with DOMs for
other browsers.

To do it otherwise would be difficult. If you
look at Firefox in Spy++ you'll see that there
are few actual windows found. If you look at
it with Active Accessibility you can go down several
levels, into a sub-level of the rendering window,
and find the URL. But that's awkward and wouldn't
work for other browsers. (I have FF 1.5. There may
even be differences with later FF versions.)

Abhishek

unread,
Dec 25, 2009, 11:02:35 AM12/25/09
to
add a label.

Private Function GetIEURL() As String
On Error Resume Next

Dim strArray() As String

With lblIEURL
.Caption = ""
.AutoSize = True
.LinkTopic = "IExplore|WWW_GetWindowInfo"
.LinkItem = "0xffffffff"
.LinkMode = 2
.LinkRequest
End With

DoEvents

If Not lblIEURL.Caption = "" Then
strArray = Split(lblIEURL.Caption, ",")
GetIEURL = Replace(strArray(0), """", "")
End If

End Function


0 new messages