Ich hab diesen Code hier aus dem Forum, ich ging davon aus, der ist richtig, hab nur aus diesem:
Delphi-Quellcode:
procedure StatusProc(buffer: Pointer; len, user: DWORD); stdcall;
begin
if (buffer <> nil) and (len = 0) then
Form1.Label5.Caption := PChar(buffer); // display connection status
if (FileNeme = '') then
exit;
if (FileStream = nil) then
FileStream:= TFileStream.Create(FileNeme, fmCreate); // create the file
if (buffer = nil) then
FileStream.Free // finished downloading
else
FileStream.Write(buffer^, len);
end;
diesen gemacht:
Delphi-Quellcode:
procedure StatusProc(buffer: Pointer; len, user: DWORD); stdcall;
begin
if (buffer <> nil) and (len = 0) then
SendMessage(win, WM_INFO_UPDATE, 8, DWORD(PChar(buffer)));
if (FileStream = nil) and RecordStatus=True then
Form1.StopRec;
if (buffer = nil) then
FileStream.Free // finished downloading
else
FileStream.Write(buffer^, len);
end;
Der FileStream wird nur wo anders erstellt (in der StopRec) und fertig.
Hm....