| | |
Get Url From IE
Please support our VB.NET advertiser: $4.95 a Month - ASP.NET Web Hosting – Click Here!
![]() |
•
•
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 |
"crystal .net .net2005 30minutes 2005 2008 access account add arithmetic array assignment basic box button buttons center check code component connectionstring convert cpu crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist editvb.net excel file-dialog firewall folder ftp generatetags hardcopy image images insert intel isnumericfuntioncall math monitor mssqlbackend mysql navigate net networking opacity output passingparameters peertopeervideostreaming picturebox1 port printpreview problem problemwithinstallation project record reports" reuse savedialog searchvb.net select serial storedprocedure string tcp temp text textbox timer toolbox trim updown user useraccounts usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio visualstudio2008 web wpf





