Hi,
ich habe unter Zuhilfenahme von Src, den ich im Netz gefunden habe (aber nicht mehr weiß wo das war) und
ein paar Modifikationen das so gelöst:
Zuerst DWebBrowserEvents2
Imports System.Runtime.InteropServices
<ComImport(), InterfaceType(ComInterfaceType.InterfaceIsIDispatch), TypeLibType( _
TypeLibTypeFlags.FHidden), Guid("34A715A0-6587-11D0-924A-0020AFC7AC4D")> _
Public Interface DWebBrowserEvents2
'' Methods
'<DispId(250)> _
'Sub BeforeNavigate2(<[In](), MarshalAs(UnmanagedType.IDispatch)> ByVal
' pDisp As Object, <[In]()> ByRef URL As Object, <[In]()> ByRef flags
' As Object, <[In]()> ByRef targetFrameName As Object, <[In]()> ByRef
' postData As Object, <[In]()> ByRef headers As Object, <[In](), Out(
' )> ByRef cancel As Boolean)
'<DispId(268)> _
'Sub ClientToHostWindow(<[In](), Out()> ByRef cx As Long, <[In](), Out(
' )> ByRef cy As Long)
'<DispId(105)> _
'Sub CommandStateChange(<[In]()> ByVal command As Long, <[In]()>
' ByVal enable As Boolean)
'<DispId(259)> _
'Sub DocumentComplete(<[In](), MarshalAs(UnmanagedType.IDispatch)> ByVal
' pDisp As Object, <[In]()> ByRef URL As Object)
'<DispId(106)> _
'Sub DownloadBegin()
'<DispId(104)> _
'Sub DownloadComplete()
'<DispId(270)> _
'Sub FileDownload(<[In](), Out()> ByRef cancel As Boolean)
'<DispId(252)> _
'Sub NavigateComplete2(<[In](), MarshalAs(UnmanagedType.IDispatch)>
' ByVal pDisp As Object, <[In]()> ByRef URL As Object)
'<DispId(271)> _
'Sub NavigateError(<[In](), MarshalAs(UnmanagedType.IDispatch)> ByVal
' pDisp As Object, <[In]()> ByRef URL As Object, <[In]()> ByRef frame
' As Object, <[In]()> ByRef statusCode As Object, <[In](), Out()>
' ByRef cancel As Boolean)
<DispId(251)> _
Sub NewWindow2(<[In](), Out(), MarshalAs(UnmanagedType.IDispatch)> ByRef _
pDisp As Object, <[In](), Out()> ByRef cancel As Boolean)
'<DispId(258)> _
'Sub OnFullScreen(<[In]()> ByVal fullScreen As Boolean)
'<DispId(256)> _
'Sub OnMenuBar(<[In]()> ByVal menuBar As Boolean)
'<DispId(253)> _
'Sub OnQuit()
'<DispId(257)> _
'Sub OnStatusBar(<[In]()> ByVal statusBar As Boolean)
'<DispId(260)> _
'Sub OnTheaterMode(<[In]()> ByVal theaterMode As Boolean)
'<DispId(255)> _
'Sub OnToolBar(<[In]()> ByVal toolBar As Boolean)
'<DispId(254)> _
'Sub OnVisible(<[In]()> ByVal visible As Boolean)
'<DispId(225)> _
'Sub PrintTemplateInstantiation(<[In](), MarshalAs(
' UnmanagedType.IDispatch)> ByVal pDisp As Object)
'<DispId(226)> _
'Sub PrintTemplateTeardown(<[In](), MarshalAs(UnmanagedType.IDispatch)>
' ByVal pDisp As Object)
'<DispId(272)> _
'Sub PrivacyImpactedStateChange(<[In]()> ByVal bImpacted As Boolean)
'<DispId(108)> _
'Sub ProgressChange(<[In]()> ByVal progress As Integer, <[In]()>
' ByVal progressMax As Integer)
'<DispId(112)> _
'Sub PropertyChange(<[In]()> ByVal szProperty As String)
'<DispId(269)> _
'Sub SetSecureLockIcon(<[In]()> ByVal secureLockIcon As Integer)
'<DispId(102)> _
'Sub StatusTextChange(<[In]()> ByVal [text] As String)
'<DispId(113)> _
'Sub TitleChange(<[In]()> ByVal [text] As String)
'<DispId(227)> _
'Sub UpdatePageStatus(<[In](), MarshalAs(UnmanagedType.IDispatch)> ByVal
' pDisp As Object, <[In]()> ByRef nPage As Object, <[In]()> ByRef
' fDone As Object)
'<DispId(263)> _
'Sub WindowClosing(<[In]()> ByVal isChildWindow As Boolean, <[In](), Out(
' )> ByRef cancel As Boolean)
'<DispId(267)> _
'Sub WindowSetHeight(<[In]()> ByVal height As Integer)
'<DispId(264)> _
'Sub WindowSetLeft(<[In]()> ByVal left As Integer)
'<DispId(262)> _
'Sub WindowSetResizable(<[In]()> ByVal resizable As Boolean)
'<DispId(265)> _
'Sub WindowSetTop(<[In]()> ByVal top As Integer)
'<DispId(266)> _
'Sub WindowSetWidth(<[In]()> ByVal width As Integer)
End Interface Dann DwebBrowserEvents2 implementierenImports System.Runtime.InteropServices
Friend Class DWebBrowserEvents2Impl
Inherits StandardOleMarshalObject
Implements DWebBrowserEvents2
Public Sub NewWindow2(ByRef pDisp As Object, ByRef cancel As Boolean) _
Implements DWebBrowserEvents2.NewWindow2
RaiseEvent NewWindow(pDisp, cancel)
End Sub
Public Event NewWindow(ByRef pDisp As Object, ByRef cancel As Boolean)
End Class |