我做了一个CMyButton类,有两个消息.
void CMyButton::OnLButtonDown(UINT nFlags, CPoint point)
{
do
{
//我的代码1
}while(CheckInt == 0);
CheckInt = 1;
}
}
void CMyButton::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
//我的代码2
CButton::OnLButtonUp(nFlags, point);
}
现在现象是,进入了OnLButtonDown后,do while一直循环,不能捕获OnLButtonUp了。我想把while的条件CheckInt == 0换成OnLButtonUp,或者在do while循环里捕获WM_LBUTTONUP。但是不会。请大家帮帮忙。
void CMyButton::OnLButtonDown(UINT nFlags, CPoint point)
{
do
{
//我的代码1
}while(CheckInt == 0);
CheckInt = 1;
}
}
void CMyButton::OnLButtonUp(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
//我的代码2
CButton::OnLButtonUp(nFlags, point);
}
现在现象是,进入了OnLButtonDown后,do while一直循环,不能捕获OnLButtonUp了。我想把while的条件CheckInt == 0换成OnLButtonUp,或者在do while循环里捕获WM_LBUTTONUP。但是不会。请大家帮帮忙。
while (!PeekMessage(&msg, NULL, WM_LBUTTONUP, WM_LBUTTONUP, PM_NOREMOVE));
在同一线程中,down消息还没有返回,消息泵就没有将up消息发出来