War ja nur mal grade Quick'n'dirty hingeschmiert.
Aber hast ja recht:
Delphi-Quellcode:
procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject;
const pDisp: IDispatch;
var URL: OleVariant);
var
PersistStream: IPersistStreamInit;
Stream: IStream;
ms: TMemoryStream;
s:
string;
begin
try
ms:=TMemoryStream.Create;
ms.Clear;
PersistStream := Webbrowser1.Document
as IPersistStreamInit;
try
Stream := TStreamAdapter.Create(ms, soReference)
as IStream;
PersistStream.Save(Stream, True);
MS.Position:=0;
SetLength(S,MS.Size);
Ms.
Read(S[1],MS.Size);
s:='
Hallo';
Ms.Clear;
MS.
Write(s[1],Length(s));
MS.Position:=0;
PersistStream.Load(Stream);
finally
Stream.Free;
finally
MS:Free;
end;
end;
so ungefähr!