我原先把鼠标进行了隐藏,在鼠标移离view时(比如选择菜单)再次显示,我在脱离view时进行了鼠标的显示设置(参代码),但是不起作用,不知为什么,求救大虾。LRESULT CMYView::OnMouseLeave(WPARAM wParam, LPARAM lParam)
{        MessageBox("leave!");//debug only
SetCursor(LoadCursor(NULL, IDC_WAIT));
ShowCursor(TRUE);
Invalidate();
}

解决方案 »

  1.   

    你SetCapture了没有?否则出了View你收不到WM_MOUSELEAVE
      

  2.   

    是没收到WM_MOUSELEAVE还是SetCursor没有起作用?
      

  3.   

    danyueer:
    经过测试(messagebox()),响应了OnMouseLeave(,)消息;现在我离开view选择menu应该怎样SetCapture
      

  4.   

    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)几次才能显示出来
      

  5.   

    直接在OnMouseLeave SetCapture
    记得ReleaseCapture