NewWindow3中的MSBrowser ActiveX控件设置取消标志 [英] MSBrowser ActiveX control setting cancel flag in NewWindow3

查看:88
本文介绍了NewWindow3中的MSBrowser ActiveX控件设置取消标志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在MFC组件中包含了MS Browser ActiveX控件.我们正在使用VB脚本来捕获ActiveX控件触发的事件.

We have included MS Browser ActiveX control in an MFC component. We are using VB script to catch the events fired by ActiveX controls.

Webbrowser1.Navigate("file:///C:/TEMP/page.html")

子WebBrowser1_NewWindow3(ByRef ppDisp,ByRef取消,ByVal dwFlags,ByVal bstrUrlContext,ByVal bstrUrl)
'需要一个新的,隐藏的,非导航的WebBrowser窗口.
 取消=真
  MsgBox(" Event NewWindow3-URL:" + bstrUrl)
结束

Webbrowser1.Navigate("file:///C:/TEMP/page.html")

Sub WebBrowser1_NewWindow3(ByRef ppDisp , ByRef Cancel ,ByVal dwFlags ,ByVal bstrUrlContext ,ByVal bstrUrl)
'A new, hidden, non-navigated WebBrowser window is needed.
  Cancel = true
  MsgBox("Event NewWindow3 - URL: " + bstrUrl)
End Sub

我们正在尝试从页面上从新的IE窗口打开页面.正在触发NewWindow3事件.但是在这里,我们将标志Cancel设置为true,期望它在取消导航时不会打开新窗口.但是即使有了这个新的IE窗口 正在开放.

From the page  we are trying to open a page from new IE window. NewWindow3 event is being fired. But here we set the flag Cancel as true , expecting it should not open new window as we cancelled the navigation. But even with this , new IE window is opening.

这是防止导航到新窗口的正确方法吗?我们也尝试过使用NewWindow2进行相同的操作.我们看到相同的结果.

is this the right way to prevent navigation for new window? We tried the samething with NewWindow2 as well. We see same result. 

任何人都可以调查一下吗?

Could any one please look into this?

谢谢

布拉玛吉.

推荐答案

我看不到与您显示的子项一起使用的任何事件处理程序.

I don't see any event handler used with the sub you display.

也请参见下图.


这篇关于NewWindow3中的MSBrowser ActiveX控件设置取消标志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆