I have a class that watchs web sites open. That works fine, but I can not get the "BeforeNavigate2" event to fire.
What am I doing wrong?
I do not think this will work with multi browsers. Is there a way to have it watch all open browsers? How???
What doesn't kill you makes you stronger.
Code:
'**** in my module****
Global SW As New SHDocVw.ShellWindows
Private SWC As New clsShellWindowsEvents
Public Sub subWindowsOpen()
Set SWC.shellWindowsEvent = SW
Set SWC.WebBrowserEvent = New SHDocVw.WebBrowser
End Sub
'**** in my Class****
Option Explicit
Public WithEvents shellWindowsEvent As SHDocVw.ShellWindows
Public WithEvents WebBrowserEvent As SHDocVw.WebBrowser
Private Sub shellWindowsEvent_WindowRegistered(ByVal lCookie As Long)
frmShellWindows.BackColor = vbBlack
End Sub
Private Sub shellWindowsEvent_WindowRevoked(ByVal lCookie As Long)
frmShellWindows.BackColor = vbWhite
End Sub
Private Sub WebBrowserEvent_BeforeNavigate2(ByVal pDisp As Object, URL As Variant, Flags As Variant, TargetFrameName As Variant, PostData As Variant, Headers As Variant, Cancel As Boolean)
frmShellWindows.BackColor = vbGreen
End Sub
What am I doing wrong?
I do not think this will work with multi browsers. Is there a way to have it watch all open browsers? How???
What doesn't kill you makes you stronger.