我用写程序,最近遇到一个问题,请教大家.
     用SetCursor(HCURSOR hCursor)
设置鼠标的形状.在某些场合无效.我在MSDN上找到这样一段话:
   If your application must set the cursor while it is in a window, make sure the class cursor for the specified window's class is set to NULL. If the class cursor is not NULL, the system restores the class cursor each time the mouse is moved.     意思是将原鼠标cursor设为NULL,我试了好几次,不知怎样才可以将原鼠标cursor设为NULL,或者说安上一段话的意思应该怎样做?
   谢谢!

解决方案 »

  1.   

    如果你是设置鼠标指针的话,直接在窗口的OnSetCursor事件中调用SetCursor就可以了。
    这句话的意思是,(如果你在窗口其它事件中)设置鼠标光标,那么窗口原来的光标就会对SetCursor产生影响使之失败。
      

  2.   

    我知道你的意思,但我的程序需要经常改变鼠标,想在响应某些事件后立即改变,而不是调用OnSetCursor,我想在PreCreateWindow中修改Window的Class,将窗口的光标设为NULL,怎么改?
      

  3.   

    你可以试试SetClassLong,这个函数可以改变窗口类本身注册的鼠标指针。