I am using the System.Windows.Forms.WebBrowser control to visit URLs. Certain URLs trigger popups which open in IE rather than in the WebBrowser. I don’t care much where they open. But somehow finding out the URLs of the popups is the most important goal. I keep seeing references to “NewWindow2” event on the web. I’m not sure how related it is, but I don’t know how to use it/where to find it, since WebBrowser does not have a NewWindow2 event, only a NewWindow event.
Any ideas?
Thanks!
EDIT
The Web_V1.NewWindow event works only to a degree. Not all popups are being detected. And some URLs only come up as “about:blank”. Ex. Use it on http://www.thedailybeast.com/. (Anybody know any other sites with notorious amounts of popups?)
Does anybody know a catch-all way to detect the resulting page of a WebBrowser popup?
Here is a previously answered question that I believe will give you the solution. (Scroll down the code window for the C# version).
System.Windows.Forms.WebBrowser open links in same window or new window with same session
Perhaps this project will help you with your goals to handle popups:
http://www.codeproject.com/KB/cpp/ExtendedWebBrowser.aspx#GoalBlock