I have the following code in VB.Net to get IE tabs’ url:
Function getIEUrl() As List(Of String)
Try
Dim list As New List(Of String)
Dim sw As New ShellWindows()
For Each browser As InternetExplorer In New ShellWindows()
list.Add(browser.LocationURL)
Next
Return list
Catch ex As Exception
Return Nothing
End Try
End Function
How can I manage it to get only the Active tab’s url?
Thanks in advance!
I haven’t done much regarding accessing other programs data, but a quick Google search put me on to this website:
http://www.eggheadcafe.com/community/csharp/2/10112922/how-to-get-current-active-tab-handle-in-an-ie7-window-using-c.aspx
From what I understand, you need to iterate through each tab process in IE and find the active one. Having the active one, you then grab the URL.