I decided to intercept the message for VK_CONTROL+C and performed a manual
clipboard copy message of plain-text. Here's an excert from my code:
#define VK_C 67
BOOL COutputRichEditCtrl::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_KEYDOWN) {
if(GetKeyState(VK_CONTROL) && pMsg->wParam == VK_C) {
PutSelInClipboard();
return TRUE;
}
}
return CRichEditCtrl::PreTranslateMessage(pMsg);
}
void COutputRichEditCtrl::PutSelInClipboard()
{
CString strText = GetSelText();
int nLen = strText.GetLength();
if(OpenClipboard()) {
EmptyClipboard();
HGLOBAL hText = GlobalAlloc(GMEM_MOVEABLE|GMEM_DDESHARE,nLen+4);
char *ptr = (char*)GlobalLock(hText);
strcpy(ptr, strText);
GlobalUnlock(hText);
::SetClipboardData(CF_TEXT,hText);
CloseClipboard();
GlobalFree(hText);
}
}
Hope this helps others and if there is a better way, feel free to post it.
Thanks,
Chris
--
"news.tkdsoftware.com" <ch***@noreply.nospam.tkdsoftware.com> wrote in
message news:wc****************************@tkdsoftware.co m...
When I create my richedit control, I specify the font to be a system fixed
font. When I cut from this control and paste it into an outlook message,
I would prefer the pasted content to always be plain text instead of weird
spaced lines and small font. How can I control this?
--