鼠标的显示/隐藏问题(急)

apcad 2004-12-03 05:45:13
我原先把鼠标进行了隐藏,在鼠标移离view时(比如选择菜单)再次显示,我在脱离view时进行了鼠标的显示设置(参代码),但是不起作用,不知为什么,求救大虾。

LRESULT CMYView::OnMouseLeave(WPARAM wParam, LPARAM lParam)
{ MessageBox("leave!");//debug only
SetCursor(LoadCursor(NULL, IDC_WAIT));
ShowCursor(TRUE);
Invalidate();
}

...全文
141 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
oyljerry 2004-12-03
  • 打赏
  • 举报
回复
直接在OnMouseLeave SetCapture
记得ReleaseCapture
qrlvls 2004-12-03
  • 打赏
  • 举报
回复
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)几次才能显示出来
apcad 2004-12-03
  • 打赏
  • 举报
回复
danyueer:
经过测试(messagebox(。。。)),响应了OnMouseLeave(,)消息;现在我离开view选择menu应该怎样SetCapture
DentistryDoctor 2004-12-03
  • 打赏
  • 举报
回复
是没收到WM_MOUSELEAVE还是SetCursor没有起作用?
danyueer 2004-12-03
  • 打赏
  • 举报
回复
你SetCapture了没有?否则出了View你收不到WM_MOUSELEAVE

15,976

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 界面
社区管理员
  • 界面
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧