FireBeforeNavigate2 method

Deprecated. Causes the browser to fire the DISPID_BEFORENAVIGATE event.


HRESULT retVal = object.FireBeforeNavigate2(pDispatch, lpszUrl, dwFlags, lpszFrameName, pPostData, cbPostData, lpszHeaders, fPlayNavSound, pfCancel);


  • pDispatch [in]
    Type: IDispatch

    A pointer to the IDispatch interface for the WebBrowser for the event.

  • lpszUrl [in]
    Type: LPCTSTR

    The URL for which the event is fired.

  • dwFlags [in]
    Type: DWORD

    Applicable flags.

  • lpszFrameName [in]
    Type: LPCTSTR

    The frame name for the event.

  • pPostData [in]
    Type: BYTE

    A pointer to post data for the event.

  • cbPostData [in]
    Type: DWORD

    The post data size, in bytes.

  • lpszHeaders [in]
    Type: LPCTSTR

    HTTP headers to send with the event.

  • fPlayNavSound [in]
    Type: BOOL

    Specifies whether to play a sound.

  • pfCancel [out]
    Type: BOOL

    Receives whether the operation should be canceled.

Return value


If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.


IDocObjectService::FireBeforeNavigate2 was introduced in Microsoft Internet Explorer 6.