Occurs when a new window is to be created for displaying a resource.
Syntax
void NewWindow2( IDispatch** ppDisp, VARIANT_BOOL* Cancel );
Parameters
- ppDisp
- [out] Address of an interface pointer that, optionally, receives the IDispatch interface pointer of a new WebBrowser or InternetExplorer object.
- Cancel
- [out] Address of a cancel flag. An application can set this parameter to TRUE to cancel the navigation operation, or FALSE to allow it to proceed.
Return Value
No return value.
Remarks
In Microsoft® Internet Explorer, this event is not fired when the user selects Window from the New option on the File menu. 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).
The application processing this notification can respond in one of three ways:
- Create a new, hidden, nonnavigated WebBrowser or InternetExplorer object that is returned in ppDisp. Upon return from this event, the object that fired this event will configure the new object and navigate to the target location.
- Cancel the navigation by setting Cancel to TRUE.
- 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.
Windows CE
Windows CE Use version 2.12 and later Minimum availability Internet Explorer 4.0
See Also
Microsoft Knowledge Base HOWTO: Cause navigation to occur in same Internet Explorer 4 Web[axsdk] , Microsoft Knowledge Base HOWTO: Use the WebBrowser Control NewWindow2 Event