鼠标的显示/隐藏问题(急)
我原先把鼠标进行了隐藏,在鼠标移离view时(比如选择菜单)再次显示,我在脱离view时进行了鼠标的显示设置(参代码),但是不起作用,不知为什么,求救大虾。
LRESULT CMYView::OnMouseLeave(WPARAM wParam, LPARAM lParam)
{ MessageBox("leave!");//debug only
SetCursor(LoadCursor(NULL, IDC_WAIT));
ShowCursor(TRUE);
Invalidate();
}
问题点数:100、回复次数:5Top
1 楼danyueer(淡月儿:从此以后,各人得各人的眼泪罢了)回复于 2004-12-03 17:50:26 得分 20
你SetCapture了没有?否则出了View你收不到WM_MOUSELEAVETop
2 楼DentistryDoctor(不在无聊中无奈,就在沉默中变态)回复于 2004-12-03 18:20:19 得分 15
是没收到WM_MOUSELEAVE还是SetCursor没有起作用?Top
3 楼apcad(新手上路)回复于 2004-12-03 18:37:12 得分 0
danyueer:
经过测试(messagebox(。。。)),响应了OnMouseLeave(,)消息;现在我离开view选择menu应该怎样SetCaptureTop
4 楼qrlvls( 空 气 )回复于 2004-12-03 20:43:09 得分 50
This function sets an internal display counter that determines whether the cursor should be displayed. The cursor is displayed only if the display count is greater than or equal to 0. If a mouse is installed, the initial display count is 0. If no mouse is installed, the display count is –1.
ShowCursor(FALSE)了几次就需要ShowCursor(TRUE)几次才能显示出来Top
5 楼oyljerry(【勇敢的心】→ ㊣提拉米苏√㊣)回复于 2004-12-03 21:16:25 得分 15
直接在OnMouseLeave SetCapture
记得ReleaseCaptureTop




