2012-03-21 54 views

回答

1

查閱這些MSDN引用和示例代碼: TranslateAcceleratorShowContextMenu

STDMETHODIMP CDHtmlDialogSubclass::ShowContextMenu(DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved, IDispatch *pdispReserved) 
{ 
    return S_OK; 
} 

STDMETHODIMP CDHtmlDialogSubclass::TranslateAccelerator(LPMSG lpMsg, const GUID * pguidCmdGroup, DWORD nCmdID) 
{ 
    if (lpMsg && lpMsg->message == WM_KEYDOWN && 
     (lpMsg->wParam == VK_F5 || 
     lpMsg->wParam == VK_CONTROL)) 
    { 
     return S_OK; 
    } 
    return CDHtmlDialog::TranslateAccelerator(lpMsg, pguidCmdGroup, nCmdID); 
} 
+0

謝謝,拳頭功能是我錯過了線索。在TranslateAccelerator中,我檢查了VK_BACK,它工作得很好。 – masche 2012-03-22 08:14:26

+2

'//防止一些IE快捷 \t如果((GetAsyncKeyState(VK_CONTROL)爲0x8000) \t \t &&(( 'N' == pMsg->的wParam) \t \t ||( 'O' == pMsg->的wParam) \t ||( 'L' == pMsg->的wParam) \t \t ||( 'P' == pMsg-> wParam中))) \t \t返回TRUE; ' 獲得更多控制 – masche 2012-03-22 08:19:13

相關問題