DWebBrowserEvents2::NewWindow2DWebBrowserEvents2::NewWindow2*
*Contents  *Index  *Topic Contents
*Previous Topic: DWebBrowserEvents2::NavigateComplete2
*Next Topic: DWebBrowserEvents2::OnFullScreen

DWebBrowserEvents2::NewWindow2

void NewWindow2(
    [out] IDispatch** ppDisp,
    [out] VARIANT_BOOL * Cancel
);

Occurs when a new window is to be created for displaying a resource. This event precedes the creation of a new window from within the WebBrowser (for example, in response to a navigation targeted to a new window, or to a scripted window.open method).

ppDisp
Address of an interface pointer that, optionally, receives the IDispatch interface pointer of a new WebBrowser or InternetExplorer object.
Cancel
Address of a cancel flag. An application can set this parameter to TRUE to cancel the navigation operation, or to FALSE to allow it to proceed.

The application processing this notification can respond in one of three ways:

  1. Create a new, hidden, non-navigated WebBrowser or InternetExplorer object that is returned in ppDisp. Upon return from this event, the object that fired this event will then configure and navigate (including a BeforeNavigate2 event) the new object to the target location.
  2. Cancel the new window creation by setting Cancel to TRUE. No object is created and the navigation is attempted on the current window (with an accompanying BeforeNavigate2 event).
  3. Do nothing and do not set ppDisp to any value. This will cause the object that fired the event to create a new InternetExplorer object to handle the navigation.

Applies To

WebBrowser, Internet Explorer


Up Top of Page
© 1997 Microsoft Corporation. All rights reserved. Terms of Use.