procedure pause(const ADelay: LongWord);
var
StartTC: DWORD;
CurrentTC: Int64;
begin
StartTC := GetTickCount;
repeat
Application.ProcessMessages;
CurrentTC := GetTickCount;
if CurrentTC < StartTC then
// tick count has wrapped around: adjust it
CurrentTC := CurrentTC + High(DWORD);
until CurrentTC - StartTC >= ADelay;
end;
begin
WebBrowser1.Navigate('http://lear4u.blogsky.com');
while WebBrowser1.ReadyState <> READYSTATE_COMPLETE do
Pause(5); // 5ms delay before re-testing
end;