I'm using VS2008 (C++) to create an IE plugin that creates a child window. It's like a normal explorer window, but customized to fit my needs. I want to destroy the window when the user navigates away from the page, by calling DestroyWindow(). Unfortunately, I don't know how to detect if the user has actually navigated away. Is there an event listener/handler that I can put in my code to accomplish this? I have seen a few in javascript that doest that, but unfortunately, I'll need to use C++..
A:
You could sync the Navigate() events in DWebBrowser2, and determine if the target URL is outside the context that you care about.
EricLaw -MSFT-
2009-06-29 23:45:52
I actually handled the BeforeNavigate2 event (in DWebBrowserEvents2) that gets fired when a user navigates away. Thanks for your help though :)
GotAmye
2009-07-13 18:24:14
So basically, you did what I suggested. :-)
EricLaw -MSFT-
2009-07-14 14:51:03