Forum

C#, WPF, webbrowser...
 
Notifications
Clear all

C#, WPF, webbrowser, detect new window open

1 Posty
1 Users
0 Reactions
1,505 Widok
0
Topic starter

NewWindow event

1 Answer
0
Topic starter
            SHDocVw.IWebBrowser2 axBrowser = typeof(WebBrowser).GetProperty("AxIWebBrowser2", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(web, null) as SHDocVw.IWebBrowser2;
            ((SHDocVw.DWebBrowserEvents_Event)axBrowser).NewWindow += OnWebBrowserNewWindow;


        private void OnWebBrowserNewWindow(string URL, int Flags, string TargetFrameName, ref object PostData, string Headers, ref bool Processed)
        {
            Processed = true;
            MessageBox.Show("TEST");
        }

Odpowiedź

Author Name

Author Email

Your question *

 
Preview 0 Revisions Saved
Share: