vb webbrowser 点击链接怎么打开默认浏览器

2024-12-16 17:28:21
推荐回答(2个)
回答1:

Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Form_Load()
WebBrowser1.Document.body.innerHTML = WebBrowser1.Document.body.innerHTML + ""
End Sub
添加Timer1时钟
Private Sub Timer1_Timer()
If WebBrowser1.Document.getElementById("host").innerHTML <> "" Then
Shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE " & WebBrowser1.Document.getElementById("host").innerText
'或者直接用默认浏览器打开,上面为用IE打开
ShellExecute hWnd, "open", "网址", vbNullString, vbNullString, 1
End If
End Sub

回答2:

你用什么方式然他用ie打开?
http://zhidao.baidu.com/question/34107777.html
看看这个