例如像这样。。

解决方案 »

  1.   


    BOOL CXXXWnd::PreTranslateMessage(MSG* pMsg) 
    {
    static BOOL bShiftUp = TRUE;
    switch(pMsg->message)
    {
    case WM_KEYUP:
    {
    if(pMsg->wParam == 0x10)
    {//释放Shift键
    bShiftUp = TRUE;
    }
    }
    break;
    case WM_KEYDOWN:
    {
    if(pMsg->wParam == 0x10)
    {//按下Shift键
    bShiftUp = FALSE;
    }
    if(pMsg->wParam == VK_RETURN)
    {//按下回车键
    //SetWindowText("...");
    }
    if(pMsg->wParam == VK_CONTROL)
    {//按下Ctrl键
    //SetWindowText("Ctrl");
    }
    }
    break;
    default:
    break;
    }
    return CWnd::PreTranslateMessage(pMsg);
    }
    仅供参考
      

  2.   

    使编辑框响应键盘消息,然后收到消息后,用paint方法把相应的“上下左右”等画在编辑框上,应该可以解决问题。
      

  3.   

    wchar_t buf[] = L"↑↓←→";
    SetDlgItemTextW(GetSafeHwnd(), IDC_EDIT1, buf);