WebBrowser BeforeNavigate2 - What is pDisp?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Spam Catcher

    #1

    WebBrowser BeforeNavigate2 - What is pDisp?

    Hi all,

    I'm using SHDocVw to hook directly into IE. Anyone know what pDisp stands
    for?

    BeforeNavigate2 (ByVal pDisp As Object, ByRef URL As Object, ByRef Flags As
    Object, ByRef TargetFrameName As Object, ByRef PostData As Object, ByRef
    Headers As Object, ByRef Cancel As Boolean)

    Is the pDisp a pointer to the sender?

    I'm keeping a list of WebBrower objects in an array - is there a way to use
    the pDisp to find the sender of the event?

    Thanks.
  • Lucian Wischik

    #2
    Re: WebBrowser BeforeNavigate2 - What is pDisp?

    Spam Catcher <spamhoneypot@r ogers.comwrote:
    >Is the pDisp a pointer to the sender?
    >I'm keeping a list of WebBrower objects in an array - is there a way to use
    >the pDisp to find the sender of the event?
    As per MSDN, pDisp is "Pointer to the IDispatch interface for the
    WebBrowser object that represents the window or frame. This interface
    can be queried for the IWebBrowser2 interface."

    So yes, pDisp points to the IDispatch interface of the sender. And
    from it you can QueryInterface to find the IWebBrowser2 of the sender.
    Or to find its IUnknown identity.

    --
    Lucian

    Comment

    • Spam Catcher

      #3
      Re: WebBrowser BeforeNavigate2 - What is pDisp?

      Lucian Wischik <lu.nn@wischik. comwrote in
      news:ifgnn2th0b 20gqq2ui4nh8fo1 47cpa4bev@4ax.c om:
      Spam Catcher <spamhoneypot@r ogers.comwrote:
      >>Is the pDisp a pointer to the sender?
      >>I'm keeping a list of WebBrower objects in an array - is there a way
      >>to use the pDisp to find the sender of the event?
      >
      As per MSDN, pDisp is "Pointer to the IDispatch interface for the
      WebBrowser object that represents the window or frame. This interface
      can be queried for the IWebBrowser2 interface."
      >
      So yes, pDisp points to the IDispatch interface of the sender. And
      from it you can QueryInterface to find the IWebBrowser2 of the sender.
      Or to find its IUnknown identity.

      Thanks Lucian,

      I'm not too familiar working with non-managed objects ... do you have any
      examples on how to query for the interface in VB.NET?

      Thanks.

      Comment

      • Spam Catcher

        #4
        Re: WebBrowser BeforeNavigate2 - What is pDisp?

        Spam Catcher <spamhoneypot@r ogers.comwrote in
        news:Xns9895789 D6DAB5usenethon eypotrogers@127 .0.0.1:
        Thanks Lucian,
        >
        I'm not too familiar working with non-managed objects ... do you have
        any examples on how to query for the interface in VB.NET?
        >
        Thanks.
        I found an easier method of checking the status of my browser Windows.

        I scan all my active Windows and compare the HWND to the handlers in BHO's
        ShellWindows.

        From there, I can retrieve the InternetExplore r object and get all the
        details I need about the browser.

        This seems more reliable than using the BHO's events... as it seems BHO's
        events don't fire consistently (there seems to be some MSDN articles
        documenting this).

        Comment

        Working...