VB6 Webbrowser控件中新窗体对应的拦截

前端之家收集整理的这篇文章主要介绍了VB6 Webbrowser控件中新窗体对应的拦截前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。


如下代码:

Dim WithEvents Web_V1 As SHDocVwCtl.WebBrowser_V1


Private Sub Form_Load()
Set Web_V1 = WebBrowser1.Object
WebBrowser1.Navigate App.Path & "/login.htm"
' WebBrowser1.Navigate2 "http://www.microsoft.com/"
End Sub

Private Sub WebBrowser1_NewWindow2(ppDisp As Object,Cancel As Boolean)
' Set ppDisp = WebBrowser2.Application
End Sub


Private Sub Web_V1_NewWindow(ByVal URL As String,_
ByVal Flags As Long,_
ByVal TargetFrameName As String,_
PostData As Variant,_
ByVal Headers As String,_
Processed As Boolean)
Processed = True
WebBrowser2.Navigate URL
End Sub

以上方法,可以将代码拦截新窗体地址!

猜你在找的VB相关文章