Показать сообщение отдельно
  #4  
Старый 28.10.2010, 08:33
Аватар для NumLock
NumLock NumLock вне форума
Let Me Show You
 
Регистрация: 30.04.2010
Адрес: Северодвинск
Сообщения: 5,426
Версия Delphi: 7, XE5
Репутация: 59586
По умолчанию

Код:
var
  url: OleVariant;
begin
  url:='http://www.delphisources.ru/';
  WebBrowser.Navigate2(url);
  while WebBrowser.ReadyState<>READYSTATE_COMPLETE do Application.ProcessMessages;
end;

а это из файла справки Delphi 6:
Цитата:
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 = nilthen
    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;
__________________
Пишу программы за еду.
__________________
Ответить с цитированием