RichEditCtrl used in chatting | CodeGuru

RichEditCtrl used in chatting

I wanted an editbox that can be used in chatting. Every chat message was inserted after the last message, user name and message is distincted with another color and message has to have readonly attribute. After all, If the message is full of the edit box, the view is autoscrolled upward. To Use the CDalsuRichEdit… […]

Written By
CodeGuru Staff
CodeGuru Staff
Jan 17, 1999
1 minute read
CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More

I wanted an editbox that can be used in chatting.
Every chat message was inserted after the last message, user name and message
is distincted with another color and message has to have readonly attribute.
After all, If the message is full of the edit box, the view is autoscrolled upward.
To Use the CDalsuRichEdit…


  1. Copy "DalsuRichEdit.h", "DalsuRichEdit.cpp" in your work directory
  2. Add your project these two files
  3. Add a member data ex:m_pDalRich or m_pDalRich
  4. Create the CDalRichEdit’s Window with suitable style

The Description of member functions



  1. AddName(CString &strName, COLORREF &crColor);

    Specify the User Name and its color

  2. AddText(CString &strTextIn, COLORREF &crColor);

    Specify text string and its color

    Don’t forget! There are "\r\n" characters on the tail of this string.
  3. AddMsg(CString &strMsg, COLORREF &crColor, BOOL bUnderLine, BOOL bBold);

    It’s general system message. ex:A User joined this room…

    In the same manner, there are "\r\n" characters on the tail of this string.

and I thank for Zafir Anjum, Tom Moor, Steve Dunn, Juraj Rojko ‘s codes…

Download demo project – 37 KB

Date Posted: 01/14/99

CodeGuru Logo

CodeGuru covers topics related to Microsoft-related software development, mobile development, database management, and web application programming. In addition to tutorials and how-tos that teach programmers how to code in Microsoft-related languages and frameworks like C# and .Net, we also publish articles on software development tools, the latest in developer news, and advice for project managers. Cloud services such as Microsoft Azure and database options including SQL Server and MSSQL are also frequently covered.

Property of TechnologyAdvice. © 2026 TechnologyAdvice. All Rights Reserved

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.