IWebBrowser2问题-如何在新窗口中打开文档?

发布于 2024-08-05 06:00:45 字数 140 浏览 15 评论 0原文

我将 IWebBrowser2 ctrl 嵌入到我自己的对话框中。我想简单地 从我的网址显示其中的促销横幅。如何禁用所有弹出窗口 控件中的菜单项并强制其在新窗口中打开链接 (目前,当我单击横幅中的链接时,它正在被打开 在同一控制范围内)。 问候 多米尼克

I have IWebBrowser2 ctrl embedded into my own dialog. I want to simply
display a promo banner within it from my url. How to disable all popup
menu items from the control and force it to open links in new window
(currently when I click on link in the banner, it is being opened
within the same control).
Regards
Dominik

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

多情出卖 2024-08-12 06:00:45

请查看以下文章:

Web 浏览器自定义

Have a look at the following article:

WebBrowser Customization

波浪屿的海角声 2024-08-12 06:00:45

我不知道是否有更方便的方法来执行此操作 - 但您始终可以拦截 BeforeExplorerNavigate2(),将输出参数 cancel 设置为 true,然后从那里执行新的 使用不同的目标框架名称 Navigate() 或打开一个新窗口。

正如 Rob 指出的那样,过滤掉源自脚本的导航事件可能会出现问题,请参阅 这个问题

I don't know if there is a more convenient way of doing this - but you could always intercept BeforeExplorerNavigate2(), set the out-parameter cancel to true and from there either do a new Navigate() with a different target frame name or open a new window.

As Rob pointed out, there might be problem with filtering out navigate events originating from scripts, see this question.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文