We help IT Professionals succeed at work.

WebBrowser1NewWindow2 ... Suppress a new browserwindow

Ogni
Ogni asked
on
Hi !
I'm using D5 and winnt/98se. I've a problem with the TWebBrowser-component. When i click on a "http-link" in a shown webpage TWebBrowser opens a second (new) window - i don't want this ;-)
I've found the event "NewWindow2" and this is my code:
-----------------
procedure TForm1.WebBrowser1NewWindow2(Sender: TObject;
  var ppDisp: IDispatch; var Cancel: WordBool);
begin
   WebBrowser1.RegisterAsBrowser := True;
   ppDisp := WebBrowser1.DefaultInterface as IDispatch;
end;
-----------------
Now clicking the first time on the extern link nothing happens (no window but not a new website, too). When i first click on a intern link (=another page in the same website) and THEN clicking the extern (=http...) link the new website is in the same (old) browserwindow...
I'm a bit too late, i think ;-)
I think there must be another event to insert the code from NewWindow2 ???

Please help... 85 points are all i have... I hope it's enough? Thanks a lot!

Best regards,
Ingo
Comment
Watch Question

Author

Commented:
Thanks a lot!

Commented:
Hey, glad to be of service :)
Just out of curiosity, though, why the 'b'? - I'm not complaining though, it's just that it doesn't make any difference to the question asker, so i try to always answer with an 'A'.

GL
Mike

Author

Commented:
Hi !
I trhink it's a good answer... So i gave you a "good"... Good is good... Not bad. Perhaps "Excellent" if it wasn't  "...waaay past my bed time..." ... Hey, a joke ;-)
Thanks a lot,
Ingo