`
huozheleisi
  • 浏览: 1235254 次
文章分类
社区版块
存档分类
最新评论

Accelerators processing before CMFCPropertyGridCtrl

 
阅读更多
Accelerators processing before CMFCPropertyGridCtrl
I am having a problem with accelerators processing before CMFCPropertyGridCtrl. So if you are editing a text box and press 'delete', it executes the accelerator command instead of deleteing a character in the edit box. How can I resolve this issue?
Implement the PreTranslateMessage function and, depending on whether the property grid has focus or not, pass the message to accelerator or not.


Code:
  m_hAccel = ::LoadAccelerators(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDR_MYDIALOG));


BOOL CMyDialog::PreTranslateMessage(MSG* pMsg) {

  ...

  if(m_hAccel && ...not grid has focus...) {
    if(::TranslateAccelerator(m_hWnd, m_hAccel, pMsg))
      return(TRUE);
  }

 return CDialog::PreTranslateMessage(pMsg);
}
<!-- / message -->
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics