VC++回车键的消息映射函数

来源:百度知道 编辑:UC知道 时间:2024/06/14 16:10:34
void CMyView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// TODO: Add your message handler code here and/or call default
//在这里写函数()
CView::OnKeyDown(nChar, nRepCnt, nFlags);
}

void CSDITestView::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
// TODO: Add your message handler code here and/or call default
if(nChar == 13)
{
MessageBox("回车键被按下!");
}

CView::OnKeyDown(nChar, nRepCnt, nFlags);
}

3