RichEdit Help Please??(PLEASE READ!)

This is a discussion on RichEdit Help Please??(PLEASE READ!) within the Windows Programming forums, part of the Platform Specific Boards category; Well, I want to use a rich edit control. I have the RichEdit window like this: #include <richedit.h> /* .................. ...

  1. #1
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490

    Question RichEdit Help Please??(PLEASE READ!)

    Well, I want to use a rich edit control. I have the RichEdit window like this:

    #include <richedit.h>

    /* .................. */
    /* Some Code */
    /* .................. */

    case WM_CREATE:

    HINSTANCE hDLL;
    hDLL = LoadLibrary("riched32.dll");

    riched = CreateWindowEx(
    WS_EX_CLIENTEDGE,
    "RichEdit", "Test",
    WS_CHILD | WS_VISIBLE,
    0, 0, 200, 200,
    hwnd,
    NULL,
    NULL,
    NULL
    );

    My question is, how do I set certain chars to red, certain chars to green, and etc.? I know it's the EM_SETCHARFORMAT, I think, but I don't know how to use it. Answers or even links should help!

    Thanks,
    Matt U.

    (BTW, I am using the MinGW compiler, and the Bloodshed Dev-C++ IDE)
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

  2. #2
    Programming is fun, mkay?
    Join Date
    Oct 2001
    Posts
    490
    Nevermind, I got it!

    CHARFORMAT cf;

    cf.cbSize = sizeof(CHARFORMAT);
    cf.dwMask = CFM_FACE | CFM_COLOR;
    cf.crTextColor = RGB(255, 0, 0);

    SendMessage(riched, EM_SETCHARFORMAT, (WPARAM) SCF_ALL, (LPARAM) (CHARFORMAT FAR *) &cf);
    Website(s): http://www16.brinkster.com/trifaze/

    E-mail: trifaze_mattu@lycos.com

    ---------------------------------
    C++ Environment: MSVC++ 6.0; Dev-C++ 4.0/4.1
    DirectX Version: 9.0b
    DX SDK: DirectX 8.1 SDK

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How can I know the actual bytes read in a file read
    By pliang in forum C++ Programming
    Replies: 1
    Last Post: 06-08-2005, 05:23 PM
  2. What Would You Use To Read User Input?
    By djwicks in forum C Programming
    Replies: 11
    Last Post: 04-05-2005, 04:32 PM
  3. Replies: 3
    Last Post: 03-04-2005, 02:46 PM
  4. Read Array pro!!Plz help!!
    By Supra in forum C Programming
    Replies: 2
    Last Post: 03-04-2002, 03:49 PM
  5. Help! Can't read decimal number
    By Unregistered in forum C Programming
    Replies: 2
    Last Post: 09-07-2001, 03:09 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21