我在程序中用了OnKeyDown,但是无法响应键盘的输入

解决方案 »

  1.   

    BOOL CTestDlgDlg::PreTranslateMessage(MSG* pMsg) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if(pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_TAB)
    {
    AfxMessageBox("Tab");
    }
    return CDialog::PreTranslateMessage(pMsg);
    }
      

  2.   

    如何响应字符,是不是在对话框此函数OnKeyDown没用
      

  3.   

    VK_A没有啊,OnKeyDown是不是没用
      

  4.   

    BOOL CTestDlgDlg::PreTranslateMessage(MSG* pMsg) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if(pMsg->message == WM_KEYDOWN && pMsg->wParam == 0x41)
    {
    AfxMessageBox("A");
    }
    return CDialog::PreTranslateMessage(pMsg);
    }0x41:a
    0x42:b
    ....OnKeyDown没用
      

  5.   

    那对于文档—视结构响应OnKeyDown是不是行啊