1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
void SendMessageToViewer(const CString & msg, const COLORREF & crNewColor)
{
long iTotalTextLength = m_Rec_Viewer.GetTextLength();
m_Rec_Viewer.SetSel( -1, -1);
m_Rec_Viewer.ReplaceSel( msg );
long iStartPos = iTotalTextLength;
CHARFORMAT cf;
cf.cbSize = sizeof(CHARFORMAT);
cf.dwMask = CFM_COLOR | CFM_UNDERLINE | CFM_BOLD;
cf.dwEffects = (unsigned long)~( CFE_AUTOCOLOR | CFE_UNDERLINE | CFE_BOLD);
cf.crTextColor = crNewColor;
long iEndPos = m_Rec_Viewer.GetTextLength();
m_Rec_Viewer.SetSel(iStartPos, iEndPos);
m_Rec_Viewer.SetSelectionCharFormat(cf);
m_Rec_Viewer.HideSelection(TRUE, FALSE);
m_Rec_Viewer.LineScroll( this->m_SequencerDialog->m_Rec_Viewer.GetLineCount() - 1 );
m_Rec_Viewer.UpdateWindow();
} |
Partager