Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2005 Mar : How to synchronize two richedits
| Subject: | How to synchronize two richedits |
| Posted by: | "Alawna" (omar.alaw..@hotmail.com) |
| Date: | Mon, 28 Mar 2005 22:37:21 |
Hi,
There are two richedits, one in my application(REinternal) and the other
in an external one(REexternal)whose content is dynamic and changes every
3 or 4 seconds. I want to fill my richedit with what in REexternal.
Here is the code I am using at the moment and it works.
PROCEDURE FillRichEdit;
VAR
txt: pchar;
loop, lines: integer;
BEGIN
Form1.RichEdit1.Lines.Clear;
GetMem(txt, $FF);
lines := SendMessage(ExternalRichEditHandle, em_getlinecount, 0, 0);
//I get the handle from another function
form1.edit1.Text := inttostr(lines);
FOR loop := 0 TO lines - 1 DO
BEGIN
move(#$FF#$00, txt^, 2);
SendMessage(ExternalRichEditHandle, em_getline, loop, integer(txt));
Form1.RE.Lines.Add(trim(txt));
END;
FreeMem(txt);
END;
But I read in MSDN that we can use EM_STREAMOUT Message to synchronize.
This seams better but frankly could not figure out how to use the
EditStream record and EditStreamCallBack
Any example code?
Thanks