描述
当创建一个新窗口时引发.延伸与新窗口的附加信息NewWindow2.
语法
SUB NewWindow3 ( _ BYVAL hwndContainer AS HWND, _ BYVAL ppDisp AS IDispatch PTR PTR, _ BYVAL pbCancel AS VARIANT_BOOL PTR, _ BYVAL dwFlags AS DWORD, _ BYVAL pwszUrlContext AS WSTRING PTR, _ BYVAL pwszUrl AS WSTRING PTR _ ) |
参数
hwndContainer |
[in]处理的OLE容器窗口. |
ppDisp |
[in, out]地址的接口指针,或者,接收IDispatch接口指针的一个新的WebBrowser或InternetExplorer对象. |
pbCancel |
[in, out] Boolean值确定是否应取消当前导航. VARIANT_TRUE 取消导航. VARIANT_FALSE 不要取消导航. |
dwFlags |
[in]旗帜从NWMF枚举属于新窗口. |
pwszUrlContext |
[in] URL网页的打开新窗口. |
pwszUrl |
[in] URL在新窗口打开. |
返回值
无返回值.
DISPID 事件
DISPID_NEWWINDOW3
此事件的DISPID定义在exdispid.inc.使用此值来确定事件处理程序时,执行的IDispatch接口Invoke method.
备注
NewWindow3之前提高NewWindow2.
在微软Internet Explorer的NewWindow3事件没有提出当用户选择从'文件'菜单上的'新的命令窗口.这一事件在创建一个新的窗口在WebBrowser.例如,NewWindow2是响应一个导航定位到一个新的窗口升起,或从脚本使用IHTMLWindow2.open方法.
当一个窗口即将被创造是NewWindow3事件,如在以下行动.
· | The user clicks a link while pressing the SHIFT key. |
· | The user right-clicks a link and selects Open In New Window. |
· | The user selects New Window from the File menu. |
· | There is a targeted navigation to a frame name that does not yet exist. |
你的浏览器应用程序还可以通过与navOpenInNewWindow标志调用Navigate或Navigate2方法触发此事件.的WebBrowser控件有一个机会来处理新的窗口创建本身.如果不是这样,一个顶级的Internet Explorer窗口被创建为一个单独的(nonhosted)过程.
处理此通知的应用程序可以以以下三种方式之一响应.
· | Create a new, hidden, nonnavigated WebBrowser or InternetExplorer object that is returned in ppDisp. Upon return from this event, the object that raised this event will then configure and navigate (including a BeforeNavigate2 event) the new object to the target location. |
· | Cancel the navigation by setting Cancel to VARIANT_TRUE. |
· | Do nothing and do not set ppDisp to any value. This will cause the object that raised the event to create a new InternetExplorer object to handle the navigation. |
引用文件
CWebBrowserEventsImpl.inc