Hmm...immer noch alle 2 sek
Delphi-Quellcode:
procedure TGetRemoteVersionThread.UpdateCaption;
var new:
string;
getit:Tidhttp;
begin
with Form1
do
begin
///
getit := Tidhttp.Create(
nil);
//chat.Lines.Clear;
//new := idhttp1.Get(URL+'/admin.php?nick='+nick+'&pw='+pw+'&go=getchat'+'&casenick='+casenick+'&lastid='+lastid);
new := getit.get(
URL+'
/admin.php?nick='+nick+'
&pw='+pw+'
&go=getchat'+'
&casenick='+casenick+'
&lastid='+lastid);
new := StringReplace(new, '
###', #13#10, [rfReplaceAll]);
if (new = '
')
OR (new = '
')
then begin
end else begin
chat.Lines.Add(new);
end;
lastid := getit.get(
URL+'
/admin.php?nick='+nick+'
&pw='+pw+'
&go=getlastid'+'
&casenick='+casenick);
///
end;
end;
// =============================================================================
procedure TGetRemoteVersionThread.Execute;
begin
Synchronize(UpdateCaption);
end;
////////////////////////////////////////////////////////////////////
procedure TForm1.Timer2Timer(Sender: TObject);
var
Thread: TGetRemoteVersionThread;
begin
Thread := TGetRemoteVersionThread.Create(True);
Thread.FreeOnTerminate := True;
Thread.Resume;
thread.DoTerminate;
end;