vb.net current url

hi,
I am trying to learn vb.net.
I came up with an idea for a project which will pretty much be a list of url's, when I click on them, I would like to have explorer open and go to that page.

I would also like my program to be able to capture the url of the last ie that was used.

so I would have ie open, if I want to add this bookmark to my program, I would open my program and hit a button.

My question is, how do I get the url of the last active explorer window.
I am not going to close the window, I just want to get the url of the one that was active before opening my program, the one that would pop up if I hit alt tab.

Thanksk
jackjohnson44Asked:
Who is Participating?
 
koolnurdCommented:
you can open an IE like this...........

The heart of the code is exposing the IWebBrowserApp interface. This interface is located in the SHDocVw.dll, which can be found (on Win2K/Xp) in the System32 directory.

The source code is simple:

Imports SHDocVw

Sub OpenBrowser(url As String) '
Dim o As Object = Nothing

Dim ie As New SHDocVw.InternetExplorerClass()

Dim wb As IWebBrowserApp = CType(ie, IWebBrowserApp)
wb.Visible = True

'Do anything else with the window here that you wish
wb.Navigate(url, o, o, o, o)
End Sub 'OpenBrowser
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.