
28.05.2012, 17:00
|
 |
Let Me Show You
|
|
Регистрация: 30.04.2010
Адрес: Северодвинск
Сообщения: 5,426
Версия Delphi: 7, XE5
Репутация: 59586
|
|
даже в справке написано:
Цитата:
This example shows how to detect when a document is completely loaded, even if it includes multiple frames. Only the final OnDocumentComplete event passes the same Dispatch interface as the OnNavigateComplete event handler.
var
CurDispatch: IDispatch; {save the interface globally }
procedure TForm1.WebBrowser1NavigateComplete2(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant);
begin
if CurDispatch = nil then
CurDispatch := pDisp; { save for comparison }
end;
procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject; const pDisp: IDispatch; var URL: OleVariant);
begin
if (pDisp = CurDispatch) then
begin
Beep; {the document is loaded, not just a frame }
CurDispatch := nil; {clear the global variable }
end;
end;
|
на худой конец:
Код:
WebBrowser1.OnDocumentComplete:=WebBrowser1DocumentComplete;
WebBrowser1.Navigate('http://www.sony-ericsson.ru/forums2/index.php');
procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
begin
if WebBrowser1.ReadyState=READYSTATE_COMPLETE then Caption:='Ok';
end;
__________________
Пишу программы за еду.
__________________
|