MFC中,如何在一个消息函数中判断另外一个消息函数 10
1个回答
展开全部
你可以设置一个BOOL变量作为标记啊,初始值为FLASE,等到然后在ONLButtonUp的消息响应函数里将变量值赋为TURE,就可以判断了啊!
例如:
void CSecondView::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call defaul
t=FALSE;
CView::OnLButtonUp(nFlags, point);
}
void CSecondView::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CClientDC dc(this);
CPen pen(PS_DASH,2,RGB(200,22,75));
CPen *pen1=dc.SelectObject(&pen);
if(TRUE==t)
{
dc.MoveTo(m_x);
dc.LineTo(point);
m_x=point;
}
CView::OnMouseMove(nFlags, point);
}
例如:
void CSecondView::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call defaul
t=FALSE;
CView::OnLButtonUp(nFlags, point);
}
void CSecondView::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
CClientDC dc(this);
CPen pen(PS_DASH,2,RGB(200,22,75));
CPen *pen1=dc.SelectObject(&pen);
if(TRUE==t)
{
dc.MoveTo(m_x);
dc.LineTo(point);
m_x=point;
}
CView::OnMouseMove(nFlags, point);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询