我在 OnChar() 中写入 AfxMessageBox(nChar, MB_ICONHAND | MB_OK);为什么没有反应?

解决方案 »

  1.   

    在PreTranslateMessage(MSG* pMsg)中加上:
    if(pMsg->message==WM_CHAR)
    {
    MessageBox("a");
    }
      

  2.   

    use the wm_char certainly!
      

  3.   

    在OnKeyDown()和OnKeyUp()函数里做文章,通过判别按下的键来做相应的变化。
      

  4.   

    void CProTopMostWndDlg::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags) 
    {
    BYTE a;
    a = (int)nChar;
    char b[1];
    sprintf(b,"%c",a);
    MessageBox(b);
    CDialog::OnChar(nChar, nRepCnt, nFlags);
    }BOOL CProTopMostWndDlg::PreTranslateMessage(MSG* pMsg) 
    {
    if(pMsg->message==WM_CHAR)
    {
    OnChar(pMsg->wParam,1,1);
    }
    return CDialog::PreTranslateMessage(pMsg);
    }
    okay ! test passed.
      

  5.   

    我在 OnKeyDown() 中写入 AfxMessageBox(nChar, MB_ICONHAND | MB_OK);为什么没有反应?
      

  6.   

    xiaobei525(好久没吃海鲜了,老板,上一盘海带!) 的方法可行!