CEdit 文本编辑框添加常用快捷键
BOOL CBuild****Dlg::PreTranslateMessage(MSG* pMsg) { int ch = (int)pMsg->wParam; if(WM_KEYDOWN == pMsg->message) { if( (GetKeyState( VK_CONTROL) & 0xFF00 ) == 0xFF00) { if( 'x' == ch || 'X' == ch) ::SendMessage(this->GetFocus()->GetSafeHwnd(),WM_CUT,0,0); if( 'C' == ch || 'c ' == ch) ::SendMessage(this->GetFocus()->GetSafeHwnd(),WM_COPY,0,0); if( 'v' == ch || 'V' == ch) ::SendMessage(this->GetFocus()->GetSafeHwnd(),WM_PASTE,0,0); if( 'a' == ch || 'A' == ch) ::SendMessage(this->GetFocus()->GetSafeHwnd(),EM_SETSEL,0,-1); if( 'z' == ch || 'Z' == ch) ::SendMessage(this->GetFocus()->GetSafeHwnd(),EM_REDO,0,-1); } } return CDialog::PreTranslateMessage(pMsg);}