假设你的浏览器窗口是TForm1的话:procedure TForm1.WebBrowser1NewWindow2(Sender: TObject; var ppDisp: IDispatch; var Cancel: WordBool); var NewWindow: TForm1; begin // a new instance of the form will be created // Eine neue Instanz wird erstellt NewWindow := TForm1.Create(self); NewWindow.Show; ppDisp := NewWindow.Webbrowser1.DefaultDispatch; end;
var ppDisp: IDispatch; var Cancel: WordBool);
var
NewWindow: TForm1;
begin
// a new instance of the form will be created
// Eine neue Instanz wird erstellt
NewWindow := TForm1.Create(self); NewWindow.Show;
ppDisp := NewWindow.Webbrowser1.DefaultDispatch;
end;