DOC: Setting Cancel to TRUE in NewWindow2 Stops Navigation

Last reviewed: February 25, 1998
Article ID: Q181779
The information in this article applies to:
  • Internet Client SDK, versions 4.0, 4.01
  • Microsoft Internet Explorer (Programming), versions 4.0, 4.01

SUMMARY

The documentation installed with the Internet Client SDK versions 4.0 and 4.01 states that setting the Cancel flag to TRUE in an event handler for the NewWindow2 event prevents the new window from opening. This is correct.

However, the documentation also states that the navigation will occur in the current browser window. This is incorrect. By design, the new browser window does not open and the intended navigation fails.

This error has been corrected in the online version of the Internet Client SDK, which is available at http://www.microsoft.com/msdn/sdk/inetsdk/help.

MORE INFORMATION

Assuming a Visual Basic project that uses the Web Browser Control, when the following Visual Basic code is executed in response to "window.open" in script or "Open In New Window" command from the context menu, no new window will open and no navigation will occur:

   Private Sub WebBrowser1_NewWindow2(ppDisp As Object, Cancel As Boolean)
       Cancel = True
   End Sub

Keywords          : AXSDKWebBrowser kbdocerr kbdocfix
Technology        : internet
Version           : WINDOWS:4.0,4.01
Platform          : WINDOWS
Issue type        : kbbug
Solution Type     : kbfix


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: February 25, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.