I am trying to implement ctrl+A in note edit control :m_editNoteTypeView" which is instance of cEdit inside class NoteDialog. My note edit is created like below.
NoteDialog::initDialog()
{
m_editNoteTypeView.CreateEx(::GetWindowLong(m_editSubject.m_hWnd, GWL_EXSTYLE), "edit", "", dwStyle | ES_READONLY, CRect(0, 0, 0, 0), this, 0);
m_editNoteTypeView.SetSel(0,-1,TRUE);
}
NoteDialog class is derived from another class named Sdialog which is finally derived from CDialog
.
I have defined PreTranslateMessage(MSG* pMsg)
in SDialog but control is not going to PreTranslateMessage ,hence my I am unable to check which key I am pressing on keboard when I am typing on note edit.
bool Sdialog::PreTranslateMessage(MSG* pMsg)
{
if (GetFocus() == this)
{
if (pMsg->message == WM_CHAR)
{
if ((LOWORD(pMsg->wParam) & VK_CONTROL) == VK_CONTROL)
{
//SetSel(0, -1);
}
}
}
return CDialog::PreTranslateMessage(pMsg);
}