DOC: Setting Cancel to TRUE in NewWindow2 Stops Navigation

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 

Additional query words:

Keywords : kbdocfix kbdocerr AXSDKWebBrowser
Version : WINDOWS:4.0,4.01
Platform : WINDOWS
Issue type : kbbug


Last Reviewed: August 27, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.