首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

CEdit 文本编辑框平添常用快捷键

2012-10-20 
CEdit 文本编辑框添加常用快捷键BOOL CBuild****Dlg::PreTranslateMessage(MSG* pMsg) {int ch (int)pMsg

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);}

热点排行