Thread: sending something to a rich edit control without keyboard

  1. #1
    Registered User
    Join Date
    Sep 2003
    Posts
    55

    sending something to a rich edit control without keyboard

    Okay.. here's my question

    how can i just send something out to get displayed on the rich edit control??

    as of right now.. i can type into it..but what if i want a line of text to appear?


    like i want to put a string together off some other event.. and just have it appear on the rich text control..

    how would i go about doing that?

    thanks

  2. #2
    Registered User
    Join Date
    Nov 2005
    Posts
    52
    The basic answer is "send the control a window message". Unfortunately, I'm not a Win32 guru, so I can't just whip up the code out of thin air, and my copy of Petzold is at the house, but there's a Win32 API call you'll use:

    Code:
    lResult = SendMessage(      // returns LRESULT in lResult
    (HWND) hWndControl,      // handle to destination control
    (UINT) EM_SETTEXTEX,      // message ID
    (WPARAM) wParam,      // = (WPARAM) () wParam;
     (LPARAM) lParam      // = (LPARAM) () lParam; );
    Where hWnd is the window handle of the control, wParam points to a SETTEXTEX structure:
    Code:
    typedef struct _settextex {
    DWORD flags;
    UINT codepage;}
     SETTEXTEX;
    and lParam is a pointer to a typical C-style string.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Printing from a Rich Edit control
    By JustMax in forum Windows Programming
    Replies: 10
    Last Post: 02-14-2009, 07:12 PM
  2. serialize rich edit control problem
    By RancidWannaRiot in forum Windows Programming
    Replies: 2
    Last Post: 11-22-2005, 07:12 PM
  3. newbie to rich edit, cant get it to work
    By hanhao in forum Windows Programming
    Replies: 1
    Last Post: 03-24-2004, 10:54 PM
  4. Edit controls not sending messages to parent window
    By EMiller in forum Windows Programming
    Replies: 5
    Last Post: 11-13-2001, 11:03 PM
  5. Rich edit control example Win API
    By Echidna in forum Windows Programming
    Replies: 1
    Last Post: 09-17-2001, 02:12 AM