PEGAR A URL OU TITULO DA JANELA IE VB 2005

SANDROROBERTO09 29/10/2010 23:52:31
#356314
.... como eu faço isso....
FROSTYNHO 04/12/2010 10:54:40
#358772
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
FROSTYNHO 05/12/2010 06:32:37
#358821
adicione referencia:
C:\Windows\System32\shdocvw.dll
microsoft.mshtml

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 Sub

agora ta mais simplificado ^^
PEGUDO 06/12/2010 14:54:14
#358917
Cara, no 2008 e 2010 eu faço como abaixo (não sei se é iqual ao 2005)

WebBrowser1.Navigate ([Ô]www.vbmania.com.br[Ô])

While Not WebBrowser1.ReadyState = WebBrowserReadyState.Complete
Application.DoEvents()
End While

Dim Titulo as String = WebBrowser1.DocumentTitle

Espero ter ajudado
Tópico encerrado , respostas não são mais permitidas