H
hilinker
Unregistered / Unconfirmed
GUEST, unregistred user!
我想用delphi实现类似MSN Messenger 的功能:
1.可任意设置字体;
2.可把小图标附在聊天记录中;
3.可在记录中带文件、html链接;
4.可将谈话记录存成一定的格式文件(比如XML格式等);
我用以下最笨的办法实现了将wwDBRichEditMSWord2中的内容以任意格式附加到wwDBRichEditMSWord1中,有点向msn了,但我觉得这样有点勉强,哪位高人在这方面有研究的能否指点一二,如果有MSN Messenger in delphi是源码最好
procedure TForm1.Button1Click(Sender: TObject);
var
TempStream : TMemoryStream;
TempStream1 : TMemoryStream;
TempStream2 : TMemoryStream;
s_str:TStringList;
i,i_length:integer;
begin
TempStream := TMemoryStream.Create;
TempStream1 := TMemoryStream.Create;
TempStream2 := TMemoryStream.Create;
wwDBRichEditMSWord2.Lines.SaveToStream(TempStream);
wwDBRichEditMSWord1.Lines.SaveToStream(TempStream1);
TempStream1.Position := TempStream1.Size;
TempStream.Position := 0;
i_length:=TempStream.Size;
TempStream2.clear;
TempStream2.SetSize(i_length - 1 );
Move((PChar(TempStream.Memory) + 1)^, (PChar(TempStream2.Memory ) )^,i_length - 1 );
TempStream.Clear;
TempStream.Write(TempStream2.memory^,i_length-1);
TempStream2.clear;
i_length:=TempStream1.Size;
TempStream2.SetSize(i_length - 6);
Move((PChar(TempStream1.Memory))^, (PChar(TempStream2.Memory ) )^,i_length - 6 );
TempStream1.Clear;
TempStream1.Write(TempStream2.memory^,i_length-6);
i_length:=TempStream.Size;
TempStream1.Write(TempStream.memory^,i_length);
TempStream1.Position := 0;
wwDBRichEditMSWord1.Lines.LoadFromStream(TempStream1);
end;
1.可任意设置字体;
2.可把小图标附在聊天记录中;
3.可在记录中带文件、html链接;
4.可将谈话记录存成一定的格式文件(比如XML格式等);
我用以下最笨的办法实现了将wwDBRichEditMSWord2中的内容以任意格式附加到wwDBRichEditMSWord1中,有点向msn了,但我觉得这样有点勉强,哪位高人在这方面有研究的能否指点一二,如果有MSN Messenger in delphi是源码最好
procedure TForm1.Button1Click(Sender: TObject);
var
TempStream : TMemoryStream;
TempStream1 : TMemoryStream;
TempStream2 : TMemoryStream;
s_str:TStringList;
i,i_length:integer;
begin
TempStream := TMemoryStream.Create;
TempStream1 := TMemoryStream.Create;
TempStream2 := TMemoryStream.Create;
wwDBRichEditMSWord2.Lines.SaveToStream(TempStream);
wwDBRichEditMSWord1.Lines.SaveToStream(TempStream1);
TempStream1.Position := TempStream1.Size;
TempStream.Position := 0;
i_length:=TempStream.Size;
TempStream2.clear;
TempStream2.SetSize(i_length - 1 );
Move((PChar(TempStream.Memory) + 1)^, (PChar(TempStream2.Memory ) )^,i_length - 1 );
TempStream.Clear;
TempStream.Write(TempStream2.memory^,i_length-1);
TempStream2.clear;
i_length:=TempStream1.Size;
TempStream2.SetSize(i_length - 6);
Move((PChar(TempStream1.Memory))^, (PChar(TempStream2.Memory ) )^,i_length - 6 );
TempStream1.Clear;
TempStream1.Write(TempStream2.memory^,i_length-6);
i_length:=TempStream.Size;
TempStream1.Write(TempStream.memory^,i_length);
TempStream1.Position := 0;
wwDBRichEditMSWord1.Lines.LoadFromStream(TempStream1);
end;