Connecting Tech Pros Worldwide Forums | Help | Site Map

WebBrowser not catching popup windows

Chris LaJoie
Guest
 
Posts: n/a
#1: Nov 15 '05
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);
}




Alvin Bruney
Guest
 
Posts: n/a
#2: Nov 15 '05

re: WebBrowser not catching popup windows


post some code
"Chris LaJoie" <chris@etriptrader.com> wrote in message
news:OU9XpO7UDHA.3148@tk2msftngp13.phx.gbl...[color=blue]
> Hi,
> I have a question regarding the catching of popups in a separate window.[/color]
I[color=blue]
> 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[/color]
to[color=blue]
> know what my code is not doing that it should be, and why it isn't[/color]
catching[color=blue]
> 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);
> }
>
>
>[/color]


Closed Thread