Irgendwie wil garnichts klappen. Ich poste mal kurz die entscheidenen Stellen:
Delphi-Quellcode:
private
{ Private-Deklarationen }
FTime: Longword;
FBytes: Longword;
...
procedure TLizenz.IdHTTP1WorkBegin(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCountMax: Integer);
begin
FTime := GetTickCount;
FBytes := 0;
end;
procedure TLizenz.IdHTTP1Work(Sender: TObject; AWorkMode: TWorkMode;
const AWorkCount: Integer);
begin
if (GetTickCount - FTime) >= 1000 then
begin
//Downloadgeschwindigkeit
label8.caption := Format('%.2f KB/s', [(AWorkCount - FBytes) / (GetTickCount - FTime)]);
FTime := GetTickCount;
FBytes := AWorkCount;
//bereits geladen von Gesamtgrösse
Label6.Caption := 'Download läuft ! '+' ('+inttostr(AWorkCount div 1024)+' kB von '+inttostr(IdHTTP1.Response.ContentStream.Size div 1024)+' kB)';
Gauge1.Progress := AWorkCount*100 div IdHTTP1.Response.ContentStream.Size;
application.ProcessMessages;
end;
end;