trichview.com

trichview.support




Use SendMessage to insert a word to TRichViewEdit


Return to index


Author

Message

Gorden Peng

Posted: 11/13/2004 9:22:27


Hello :


If I want to insert a word to RichViewEdit useing SendMessage, How to write

the code?


below is my function, It can work in memo, edit, DBEdit, DBMemo, DBGrid,

but can't work in RichViewEdit.

//=================================================

procedure InsertWord(str:string);

var

   i: integer;

begin

  if (screen.Forms[1].ActiveControl is TCustomEdit) or (screen.Forms[1].ActiveControl

is TCustomDBGrid) or

     (screen.Forms[1].ActiveControl is TRichViewEdit) then

    begin

      SendMessage(screen.Forms[1].ActiveControl.Handle, EM_REPLACESEL, 0,

LPARAM(LPCSTR(str)));

        end;

end;

//=====================================================

May you help me to fix this question? thank you.


Gorden Peng





Powered by ABC Amber Outlook Express Converter