WebBrowser not catching popup windows

  • Thread starter Thread starter Chris LaJoie
  • Start date Start date
C

Chris LaJoie

Hi,
I have a question regarding the catching of popups in a separate window. I
just can't get it to work. My browser is extremely simple and is designed
for a single purpose: to open a 'netlet' to a particular VPN on the United
Airlines network. The trouble is, I can't get my app to catch the popup
(which is the netlet). The netlet opens outside in a separate IE window
instead. I have a VB6 app that does what I want perfectly fine with
virtually exactly the same code (modified syntax of course ;). I'd like to
know what my code is not doing that it should be, and why it isn't catching
the popup window. Thanks!



below is the relevant code
note: code may wrap

private void fNetlet_Load(object sender, System.EventArgs e) {
if(!common.DEBUG_BROWSER) {
Browser.Silent = true;
Netlet.Silent = true;
}
Browser.RegisterAsBrowser = true;
Netlet.RegisterAsBrowser = true;
this.Visible = false;
this.Hide();
}

private void fNetlet_Closing(object sender, CancelEventArgs e) {
this.Hide();
}

private void fNetlet_Resize(object sender, EventArgs e) {
Browser.Width = this.Width - 4;
Browser.Height = this.Height / 2 - 4;
Netlet.Top = Browser.Bottom - 4;
Netlet.Width = this.Width - 4;
Netlet.Height = Browser.Height - 4;
}

private void Browser_NewWindow2(object sender,
AxSHDocVw.DWebBrowserEvents2_NewWindow2Event e) {
e.ppDisp = Netlet.Application;
Browser.Stop();
}

public void navigate(string url) {
object dummy = null;
object u = (object)url;
Browser.Navigate2(ref u, ref dummy, ref dummy, ref dummy, ref dummy);
}
 
Back
Top