如果我想注册一个ctrl+f1的热键应该怎么做

解决方案 »

  1.   

    RegisterHotKey(m_hWnd,0Xa002,MOD_CONTROL,VK_F1);
    ::SetFocus(m_hWnd);
    ***************************************************************BOOL PreTranslateMessage(MSG* pMsg) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if (pMsg->message==WM_HOTKEY && pMsg->wParam==0Xa002)
    {
    AfxMessageBox("My MessageBox!");
    }
    return CDialog::PreTranslateMessage(pMsg);
    }LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam) 
    {
    // TODO: Add your specialized code here and/or call the base class
    if(message == WM_CLOSE)
    {
    ::UnregisterHotKey(m_hWnd,0Xa002);
    }
    return CDialog::WindowProc(message, wParam, lParam);
    }