屏蔽系統快捷鍵

 添加PreTranslateMessage映射函數
然後pMsg ->wParam == 'O' && GetKeyState(VK_CONTROL)<0中改成相應字母和控件
BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)
{
    if(pMsg ->message == WM_KEYDOWN)
        if((pMsg ->wParam == 'O' && GetKeyState(VK_CONTROL)<0) ||(pMsg ->wParam == 'S' && GetKeyState(VK_CONTROL)<0)
            ||(pMsg ->wParam == 'N' && GetKeyState(VK_CONTROL)<0 ))
            return TRUE;
    // TODO: Add your specialized code here and/or call the base class
   
    return CFrameWnd::PreTranslateMessage(pMsg);
}
發佈了19 篇原創文章 · 獲贊 3 · 訪問量 12萬+
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章