PreTranslateMessage爲何不能使鼠標失效?

PreTranslateMessage爲何不能使鼠標失效? 

BOOL CDlgMediaPlay::PreTranslateMessage(MSG* pMsg)
{
 if(WM_RBUTTONDOWN == pMsg->message)
 {
  AfxMessageBox("123");
  return TRUE;
 }
 else
  return CDialog::PreTranslateMessage(pMsg);
}
以上程序可以實現我點右鍵就跳出"123"對話框
但我現在是如果點右鍵的話只要返回就行了
那就是把afxmessagebox("123")去掉
但是去掉了右鍵就又有用了????
請問該如何屏蔽啊?

要不要吧WM_RBUTTONUP也屏掉

試試
return FALSE;


不會的
BOOL CTest6Dlg::PreTranslateMessage(MSG* pMsg)
{
 if(WM_RBUTTONDOWN == pMsg->message)
 {
 // AfxMessageBox("123");
  return TRUE;
 }

 return CDialog::PreTranslateMessage(pMsg);
}

void CTest6Dlg::OnRButtonDown(UINT nFlags, CPoint point)
{
         AfxMessageBox("123");
 
 CDialog::OnRButtonDown(nFlags, point);
}


這樣是不會彈出123的。


if(WM_RBUTTONDOWN==pMsg->message)
 return TRUE;
else if(WM_RBUTTONUP==pMsg->message)
       return TRUE;

兩個都屏蔽掉

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章