RichEdite响应快捷键事件
// 响应快捷键事件
BOOL CChatInputDlg::ShortcutKeyEvent(UINT nID, MSG* pMsg)
{
// 事件为空,返回
if (NULL == pMsg)
{
return FALSE;
}
// 是否按下CTRL键
if(GetKeyState(VK_CONTROL) < 0)
{
// 是否按下A键
if (pMsg->wParam == 65)
{
if (nID == IDC_RICHEDT_INPUT)
{
m_RichEditInput.SetSel(0, -1);
return TRUE;
}
}
// 是否按下C键
if (pMsg->wParam == 67)
{
if (nID == IDC_RICHEDT_INPUT)
{
RichEditCopy();
return TRUE;
}
}
// 是否按下V键
if (pMsg->wParam == 86)
{
if (nID == IDC_RICHEDT_INPUT)
{
RichEditPaste();
return TRUE;
}
}
// 是否按下X键
if (pMsg->wParam == 88)
{
if (nID == IDC_RICHEDT_INPUT)
{
RichEditCut();
return TRUE;
}
}
// 是否按下Z键
if (pMsg->wParam == 90)
{
if (nID == IDC_RICHEDT_INPUT)
{
RichEditUndo();
return TRUE;
}
}
}
return FALSE;
}