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;
兩個都屏蔽掉