rt

解决方案 »

  1.   

    void CxxWnd::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags) 
    {
    CWnd::OnKeyDown(nChar, nRepCnt, nFlags); switch(nChar)
    {
    case VK_TAB :
    if(GetKeyState(VK_CONTROL) < 0)
    {
    //YOUR CODE
    }
    }
    }
      

  2.   

    BOOL bControlKeyDown = FALSE;
            bControlKeyDown = GetAsyncKeyState(VK_CONTROL) >>
    ((sizeof(SHORT) * 8) - 1);        if((pMsg->wParam == 0x41//换成TAB) && bControlKeyDown)
            {
                this->SetSel(0, -1);
            }
      

  3.   

    (二)组合键的用法:(本例响应Ctrl+X键)
    BOOL CMydilog::PreTranslateMessage(MSG* pMsg) 
    {
    // TODO: Add your specialized code here and/or call the base class

    if (pMsg->message == WM_KEYDOWN)
    {
    switch (pMsg->wParam)
    {
    case VK_ESCAPE:
    SetFocus ();
    return TRUE;
    case 'X':
    if(::GetKeyState(VK_CONTROL) < 0)//如果是Shift+X这里就
                                                                 //改成VK_SHIFT
    MessageBox("hello");
    return TRUE;

    }
    }
    return CDialog::PreTranslateMessage(pMsg);
    }
      

  4.   


    BOOL CMydilog::PreTranslateMessage(MSG* pMsg) 
    {
    // TODO: Add your specialized code here and/or call the base class

    if (pMsg->message == WM_KEYDOWN)
    {
    switch (pMsg->wParam)
    {
    case VK_TAB:
    if(::GetKeyState(VK_CONTROL) < 0)
                            MessageBox("hello");
    return TRUE;

    }
    }
    return CDialog::PreTranslateMessage(pMsg);
    }
      

  5.   

    windyloft(神在看着你)和osborn(SEANX) ???好像你们说的不对吧???Ctrl+Tab不同于普通的序列,在没有经过修改它是系统默认的切换输入法的快捷键。对于这种级别的组合键,可以通过设置Windows全局键盘钩子来响应。函数是SetWindowsHookEx,必须要在一个dll中静态实现。