Click here to Skip to main content
15,891,721 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: unable to write into the shared memory Pin
manoharbalu22-May-12 4:14
manoharbalu22-May-12 4:14 
GeneralRe: unable to write into the shared memory Pin
Richard Andrew x6422-May-12 4:22
professionalRichard Andrew x6422-May-12 4:22 
GeneralRe: unable to write into the shared memory Pin
manoharbalu22-May-12 4:33
manoharbalu22-May-12 4:33 
AnswerRe: unable to write into the shared memory Pin
Richard Andrew x6422-May-12 4:36
professionalRichard Andrew x6422-May-12 4:36 
GeneralRe: unable to write into the shared memory Pin
manoharbalu22-May-12 4:50
manoharbalu22-May-12 4:50 
AnswerRe: unable to write into the shared memory Pin
Richard Andrew x6422-May-12 4:58
professionalRichard Andrew x6422-May-12 4:58 
GeneralRe: unable to write into the shared memory Pin
manoharbalu22-May-12 18:41
manoharbalu22-May-12 18:41 
QuestionChange Specific Text Color - RichEdit Control Pin
AmbiguousName22-May-12 2:13
AmbiguousName22-May-12 2:13 
hello guys... I am trying to write this small chat application. Here, I want the user name, colored differently than his/her message. Now I had a look at the CHARFORMAT structure but don't know which of the value needs to be set, in order to change color of my user name only. Here is what it looks like
typedef struct _charformat {
    	UINT cbSize;
	DWORD dwMask;
	DWORD dwEffects;
	LONG yHeight;
	LONG yOffset;
	COLORREF crTextColor;
	BYTE bCharSet;
	BYTE bPitchAndFamily;
	TCHAR szFaceName[LF_FACESIZE];
} CHARFORMAT;

Here is definition for my function which adds the message to the rich edit control
void CConnectUserDlg::AddMessage(LPCTSTR strUser, LPCTSTR strMessage)
{

  CString strCompleteMsg;
  strCompleteMsg.Format("%s:\t%s\n", strUser, strMessage); //concatinating user with his/her message

  int nLength;
	
  nLength = m_richMessages.GetTextLength(); //richMessages: RichEdit Control Var
  m_richMessages.SetSel(nLength, nLength);

  m_richMessages.ReplaceSel(strCompleteMsg);
  m_richMessages.SetSel(-1, 0);

  GetDlgItem(IDC_EDIT)->SetWindowText("");
  GetDlgItem(IDC_EDIT)->SetFocus();
}

Thanks for any pointers.

This world is going to explode due to international politics, SOON.

AnswerRe: Change Specific Text Color - RichEdit Control Pin
Richard Andrew x6422-May-12 2:24
professionalRichard Andrew x6422-May-12 2:24 
GeneralRe: Change Specific Text Color - RichEdit Control Pin
AmbiguousName22-May-12 2:44
AmbiguousName22-May-12 2:44 
GeneralRe: Change Specific Text Color - RichEdit Control Pin
Richard Andrew x6422-May-12 2:49
professionalRichard Andrew x6422-May-12 2:49 
QuestionRe: Change Specific Text Color - RichEdit Control Pin
AmbiguousName22-May-12 2:56
AmbiguousName22-May-12 2:56 
AnswerRe: Change Specific Text Color - RichEdit Control Pin
Richard Andrew x6422-May-12 3:05
professionalRichard Andrew x6422-May-12 3:05 
AnswerRe: Change Specific Text Color - RichEdit Control Pin
SaahilPriya22-May-12 19:08
SaahilPriya22-May-12 19:08 
AnswerRe: Change Specific Text Color - RichEdit Control Pin
Richard MacCutchan22-May-12 2:25
mveRichard MacCutchan22-May-12 2:25 
QuestionMFC help: map integration in GUI Pin
jawadali47722-May-12 1:02
jawadali47722-May-12 1:02 
AnswerRe: MFC help: map integration in GUI Pin
Richard MacCutchan22-May-12 1:28
mveRichard MacCutchan22-May-12 1:28 
QuestionBasic Help Pin
Dasttann77721-May-12 18:03
Dasttann77721-May-12 18:03 
QuestionRe: Basic Help Pin
CPallini21-May-12 21:52
mveCPallini21-May-12 21:52 
AnswerRe: Basic Help Pin
Dasttann77721-May-12 21:56
Dasttann77721-May-12 21:56 
GeneralRe: Basic Help Pin
CPallini21-May-12 22:05
mveCPallini21-May-12 22:05 
GeneralRe: Basic Help Pin
Dasttann77721-May-12 22:07
Dasttann77721-May-12 22:07 
GeneralRe: Basic Help Pin
CPallini21-May-12 22:19
mveCPallini21-May-12 22:19 
GeneralRe: Basic Help Pin
Dasttann77721-May-12 22:57
Dasttann77721-May-12 22:57 
QuestionRe: Basic Help Pin
CPallini21-May-12 23:13
mveCPallini21-May-12 23:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.