| | |
Get Url From IE
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Apr 2008
Posts: 75
Reputation:
Solved Threads: 0
vbnet Syntax (Toggle Plain Text)
Imports mshtml Imports SHDocVw Imports Microsoft.Win32 Imports System.Runtime.InteropServices Public Class Form1 Public Const BaseKey As String = "SOFTWARE\Microsoft\Internet Explorer\Extensions" Public Const SubKey As String = "{10954C80-4F0F-11d3-B17C-00C0DFE39736}" Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim reg As RegistryKey = Registry.LocalMachine Dim sk As RegistryKey = reg.OpenSubKey(BaseKey, True) sk = sk.CreateSubKey(SubKey) sk.SetValue("ButtonText", "Button") sk.SetValue("CLSID", "{1FBA04EE-3024-11D2-8F1F-0000F87ABD16}") sk.SetValue("Default Visible", "Yes") sk.SetValue("Exec", "D:\Working\IEToolbarButtons\IEToolbarButtons\bin\Debug\IEToolbarButtons.exe") sk.SetValue("HotIcon", "C:\Windows\System\setup.ico") sk.SetValue("Icon", "C:\Windows\System\setup.ico") sk.Close() reg.Close() End Sub 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.IHTMLDocument2 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 MessageBox.Show(myLocalLink) End If Next End End Sub End Class
mshtml-->Add reference microsoft.mshtml
SHDocVw--> Go to Add Reference-->Go to Broese tab-->C:--Windows--System32--shdocvw.dll
sk.SetValue("HotIcon", "C:\Windows\System\setup.ico")
C:\Windows\System\setup.ico--In place of it,Add any icon that has extension .ico,cz its not a valid ico file.
OUTPUT--
Open Two Sites are open google.com, daniweb.com.
Now open site yahoo.com. Click on button that is created with icon u added,when u clik on it.it shows as messageBox,
Fisrt google.com,daniweb.com & then yahoo.com
Cz all these sites are open.
I want that whether two sites are open google.com,daniweb.com,O/p Should be only yahoo.com
Last edited by cscgal; Sep 7th, 2008 at 9:36 pm. Reason: Added code tags
![]() |
Similar Threads
- Save Time and Effort in Typing URL Addresses (Windows tips 'n' tweaks)
- How to keep new URL's on top?? (Web Browsers)
- URL changing (Linux Servers and Apache)
- IE Cache not deleting a URL (Web Browsers)
- URL Changes!! (Web Browsers)
- IE URL Suffix (Web Browsers)
- url redirects to yahoo.com (Windows NT / 2000 / XP)
Other Threads in the VB.NET Forum
- Previous Thread: Strange MenuStrip Behaviour
- Next Thread: I am needing a control array, but VB.NET doesn't support them...
| Thread Tools | Search this Thread |
.net .net2008 2005 2008 access account arithmetic array basic beginner bing browser button buttons center check code combobox crystalreport cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic dropdownlist excel fade file-dialog filter forms ftp generatetags hardcopy html images input insert intel internet mobile monitor ms net networking objects open output panel passingparameters pdf picturebox picturebox1 port position printing problem project save searchvb.net select serial settings shutdown soap sqlserver survey tcp temperature text textbox timer timespan toolbox transparency trim update updown user vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic.net visualstudio visualstudio.net visualstudio2008 web winforms wpf wrapingcode year





