I intend to put a CRichEditCtrl in a CDockablePane, and I succeeded some way, but not completelly: I can write text in this embeeded CRichEditCtrl, but I have not formating and I noticed something strange: the keyboard shortcuts is functional only if I keep Shift key down. For instance, if I want to 'Paste' something, instead of Ctrl+V, I need to press Ctrl+Shift+V, and so on.
I attached here a sample project that reveal the problem.
Here is the code for creating CRichEditCtrl inside of CDockablePane:
int CClassView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDockablePane::OnCreate(lpCreateStruct) == -1)
return -1;
CRect rectDummy;
rectDummy.SetRectEmpty();
constexpr DWORD dwStyle = WS_VISIBLE | WS_HSCROLL | WS_VSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_WANTRETURN;
if (! m_wndRichEditCtrl.Create(dwStyle, rectDummy, this, IDC_RICHEDIT_QUERY))
{
TRACE(_T("Failed to create rich edit control\n"));
return -1; // fail to create
}
m_wndRichEditCtrl.PostMessage(EM_SETEVENTMASK, 0, ENM_MOUSEEVENTS | ENM_SCROLLEVENTS | ENM_KEYEVENTS);
return 0;
}
And something strange: if I copy something from, let say, Visual Studio, and I paste it here, the formating is not kept, as I said ... why ?

