15,980
社区成员
发帖
与我相关
我的任务
分享
CHARFORMAT cf;
ZeroMemory( &cf, sizeof(CHARFORMAT) );
cf.cbSize = sizeof(CHARFORMAT);
cf.dwMask = CFM_COLOR | CFM_FACE | CFM_LINK | CFM_SIZE | CFM_UNDERLINE;
cf.dwEffects = CFE_LINK | ~CFE_AUTOCOLOR;
cf.crTextColor = RGB( 0, 114, 193 ); // 文字颜色
// 设置“打开文件”的超连接
int nTotalTextLength = m_ChatDisplay.GetWindowTextLength();
m_ChatDisplay.ReplaceSel( _T("打开文件") );
int nEndPos = m_ChatDisplay.GetWindowTextLength();
m_ChatDisplay.SetSel( nTotalTextLength, nEndPos );
m_ChatDisplay.SetSelectionCharFormat( cf );