This is obtained immediately after the page is downloaded:
--------------------------------------------------------------------------------
Unit unit1;
Interface
Uses
Windows, messages, sysutils, variants, classes, graphics, controls, forms,
Dialogs, olectrls, shdocvw, stdctrls;
Type
Tform1 = Class (tform)
Webbrowser1: twebbrowser;
Button1: tbutton;
Button2: tbutton;
Procedure formcreate (Sender: tobject );
Procedure webbrowser1documentcomplete (asender: tobject;
Const Pdisp: idispatch; var URL: olevariant );
End;
VaR
Form1: tform1;
Implementation
{$ R *. DFM}
Uses MSHTML;
Var window: IHTMLWindow2;
{Opening the page at the time of creation}
Procedure TForm1.FormCreate (Sender: TObject );
Begin
WebBrowser1.Align: = alTop;
WebBrowser1.Navigate ('HTTP: // del.cnblogs.com ');
End;
{Retrieve window object when the page is opened}
Procedure TForm1.WebBrowser1DocumentComplete (ASender: TObject;
Const pDisp: IDispatch; var URL: OleVariant );
Begin
If pDisp = (ASender as TWebBrowser). Application then
Begin
Window: = (ASender as TWebBrowser). Document as IHTMLDocument2). parentWindow;
End;
End;
End.
--------------------------------------------------------------------------------