用AfxGetApp()->LoadCursor(IDC_HAND)说IDC_HAND没有定义
但它不是在WINUSER.H里定义了吗?怎么样可以使用手形光标?

解决方案 »

  1.   

    你仔细看看定义的地方是不是被#ifdef/#endif包围了,这是关键。
      

  2.   

    的确
    #if(WINVER >= 0x0500)
    #define IDC_HAND            MAKEINTRESOURCE(32649)
    #endif /* WINVER >= 0x0500 */
    那要怎么做才可以用IDC_HAND?
      

  3.   

    说IDC_HAND没有定义
    是因为你没有加进来资源文件了~~
      

  4.   

    系统不是有一些标准的光标吗?
    AfxGetApp()->LoadCursor(IDC_ARROW)没有问题,但我并没有定义IDC_ARROW
      

  5.   

    楼主到MSDN里面查看LoadCursor Function的时候,在下面有:
    HCURSOR LoadCursor(          HINSTANCE hInstance,
        LPCTSTR lpCursorName
    );
    其中:
    IDC_APPSTARTING
    Standard arrow and small hourglass
    IDC_ARROW
    Standard arrow
    IDC_CROSS
    Crosshair
    IDC_HAND
    Windows 98/Me, Windows 2000/XP: Hand//特殊一点~~~
    IDC_HELP
    Arrow and question 
    这个是版本说明:
    Minimum system required Macros to define 
    Windows Server 2003 family _WIN32_WINNT>=0x0502 
    Windows XP _WIN32_WINNT>=0x0501 
    Windows 2000 _WIN32_WINNT>=0x0500 
    Windows NT 4.0 _WIN32_WINNT>=0x0400 
    Windows Me _WIN32_WINDOWS=0x0490 
    Windows 98 _WIN32_WINDOWS>=0x0410 
    Internet Explorer 6.0 _WIN32_IE>=0x0600 
    Internet Explorer 5.01, 5.5 _WIN32_IE>=0x0501 
    Internet Explorer 5.0, 5.0a, 5.0b _WIN32_IE>=0x0500 
    Internet Explorer 4.01 _WIN32_IE>=0x0401 
    Internet Explorer 4.0 _WIN32_IE>=0x0400 
    Internet Explorer 3.0, 3.01, 3.02 _WIN32_IE>=0x0300 
    也就是:
    For example, to use the features specifically ed for Windows 2000 in the header files, you need to explicitly define _WIN32_WINNT as 0x0500 or greater. You can define the symbols using the #define statement in each source file, or by specifying the /D_WIN32_WINNT=0x0500 compiler option supported by Visual C++.
      

  6.   

    Windows 98/Me, Windows 2000/XP: Hand//特殊一点~~~
    这一行是什么意思?
      

  7.   

    #define _WIN32_WINNT  0x0500 
    #include "winuser.h"
    int i=IDC_HAND;还是不行