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 DominikAnswer1:
Have a look at the following article:
<a href="http://msdn.microsoft.com/en-us/library/aa770041.aspx" rel="nofollow">WebBrowser Customization</a>Answer2:
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 <a href="https://stackoverflow.com/questions/2925279/iwebbrowser2-how-to-force-links-to-open-in-new-window/3066267#3066267" rel="nofollow">this question</a>.