Imports mshtml Public Class Form1 ~~~~~~~~~~~~~~~~~~~ Dim WithEvents IE As SHDocVw.InternetExplorer Dim WithEvents CurrentDoc As HTMLDocument Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Dim SWs As New SHDocVw.ShellWindows Dim IEx As SHDocVw.InternetExplorer Dim i As Integer = 1 Timer1.Enabled = False For Each IEx In SWs Try If TypeOf (IEx.Document) Is HTMLDocument Then IE = IEx CurrentDoc = IE.Document CurrentDoc.url = "http://google.com" End If i = i + 1 Catch ex As Exception MessageBox.Show(ex.Message) End Try Next End Sub
Imports SHDocVw Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim browser As SHDocVw.InternetExplorer Dim myLocalLink As String Dim myDoc As mshtml.IHTMLDocument Dim shellWindows As SHDocVw.ShellWindows = New SHDocVw.ShellWindows() Dim filename As String For Each ie As SHDocVw.InternetExplorer In shellWindows filename = System.IO.Path.GetFileNameWithoutExtension(ie.FullName).ToLower() If filename = "iexplore" Then browser = ie myDoc = browser.Document myLocalLink = myDoc.url myDoc.url = "http://www.google.com" 'MessageBox.Show(myLocalLink) End If Next End Sub
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)