鼠标滑过改变鼠标形状

来源:互联网 发布:直播服务器搭建java 编辑:程序博客网 时间:2024/05/13 02:33

处理父窗口的WM_SETCURSOR消息:  
  BOOL   CYourDlg::OnSetCursor(CWnd*   pWnd,   UINT   nHitTest,   UINT   message)    
  {  
      //   TODO:   Add   your   message   handler   code   here   and/or   call   default  
      if   (pWnd   ==   GetDlgItem(IDC_BUTTON))  
      {  
          SetCursor(LoadCursor(NULL,   IDC_HAND));  
          return   TRUE;  
      }  
      return   CDialog::OnSetCursor(pWnd,   nHitTest,   message);  
  }

 

如果编译器提示IDC_HAND找不到,你可以在文件头部加上:  
  #define   IDC_HAND   MAKEINTRESOURCE(32649)

原创粉丝点击