views:

100

answers:

1

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-
I actually handled the BeforeNavigate2 event (in DWebBrowserEvents2) that gets fired when a user navigates away. Thanks for your help though :)
GotAmye
So basically, you did what I suggested. :-)
EricLaw -MSFT-