我试了一下:use richedit就可以用em_getseltext了,<br>请大家看下我这段代码有何问题<br>var<br> num: integer;<br> buffer: array[1..1024*1024] of char;<br> str: string;<br>begin<br> num := SendMessage(f3, EM_GETSELTEXT, 0, longint(@buffer));<br> str := string(buffer);<br> showmessage(str );<br> str := str + str;<br> SendMessage(f3, EM_REPLACESEL, 1, longint(@str));<br>end;