在Dialog中有一个CGridCtrl,我想在鼠标双击CGridCtrl的时,在Grid控件前先接收到鼠标双击消息?我用如下代码为什么不行?
BOOL CViewRptSrc::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if (pMsg->hwnd == m_Grid.GetSafeHwnd())
{
if (pMsg->message == NM_DBLCLK )
MessageBox("1111");
}
return CFormView::PreTranslateMessage(pMsg);
}
3ks
BOOL CViewRptSrc::PreTranslateMessage(MSG* pMsg)
{
// TODO: Add your specialized code here and/or call the base class
if (pMsg->hwnd == m_Grid.GetSafeHwnd())
{
if (pMsg->message == NM_DBLCLK )
MessageBox("1111");
}
return CFormView::PreTranslateMessage(pMsg);
}
3ks
了吗?已经指明在哪里了,
只要响应鼠标双击消息就行了.
我要在Grid处理DB_CLICK消息前先处理一些事!