zoukankan      html  css  js  c++  java
  • 在ListCtrl控件中设置自定义光标

     ::SetCursor(::LoadCursor   (::AfxGetInstanceHandle(),   MAKEINTRESOURCE(IDB_BMP_MOUSE)));

    void   CMyListCtrl::OnItemchanged(NMHDR*   pNMHDR,   LRESULT*   pResult) 

                      NM_LISTVIEW*   pNMListView   =   (NM_LISTVIEW*)   pNMHDR; 

                      int   nRow   =   pNMListView-> iItem; 

    if((nRow   ==   2)||(nRow   ==   3)) 

                                        //   发送消息,通知光标的重新设置 
                                        //   这里不知道怎么发送消息?   message   参数不能为1吧????? 
    PostMessage(WM_SETCURSOR,0,1); 


                      *pResult   =   0; 


    //   设置光标 
    BOOL   CMyListCtrl::OnSetCursor(CWnd*   pWnd,   UINT   nHitTest,   UINT   message)   

    //   TODO:   Add   your   message   handler   code   here   and/or   call   default 
    if(message   ==   1) 
                      { 
                            ::SetCursor(LoadCursor(NULL,   IDC_HAND)); 
          return   TRUE; 
                      } 
                      
                      //   如果自定义光标,下面的必须去掉,否则,系统按照自定义的光标进行重绘, 
                      //   设置不成功 
                      //return   CListCtrl::OnSetCursor(pWnd,   nHitTest,   message); 

  • 相关阅读:
    POJ 3093 Margaritas on the River Walk(背包)
    BZOJ 2287 【POJ Challenge】消失之物(DP+容斥)
    WC2017 Day1
    WC2017 Day0
    WC2017 Conclusion
    WC2017 Day6
    UOJ #58 糖果公园
    WC2017 Day5
    codevs 1946 阿狸的打字机
    HDU 2457 DNA_repair
  • 原文地址:https://www.cnblogs.com/lidabo/p/3701792.html
Copyright © 2011-2022 走看看