Solved current url

Posted on 2006-04-27
Last Modified: 2007-12-19
I am trying to learn
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.

Question by:jackjohnson44
    1 Comment
    LVL 2

    Accepted Solution

    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

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…
    For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK ( for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now