?
Solved

vb.net current url

Posted on 2006-04-27
1
Medium Priority
?
713 Views
Last Modified: 2007-12-19
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
0
Comment
Question by:jackjohnson44
1 Comment
 
LVL 2

Accepted Solution

by:
koolnurd earned 2000 total points
ID: 16559678
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

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
The object model of .Net can be overwhelming at times – so overwhelming that quite trivial tasks often take hours of research. In this case, the task at hand was to populate the datagrid from SQL Server database in Visual Studio 2008 Windows applica…
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Loops Section Overview
Suggested Courses
Course of the Month15 days, 22 hours left to enroll

850 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