每当中加入WM_MOUSEWHEEL消息就会出错,说没有定义,各位前辈指导一下.

解决方案 »

  1.   

    去stdafx.h文件中
    #define _WIN32_WINNT 0x0400 //<--这里改成0x0400
      

  2.   

    设置win的版本
    如楼上,或者更高
      

  3.   

    E:\vc++\System\System.cpp(70) : error C2065: 'WM_MOUSEWHEEL' : undeclared identifier
    E:\vc++\System\System.cpp(70) : error C2051: case expression not constant
    E:\vc++\System\System.cpp(86) : error C2065: 'SPI_GETWHEELSCROLLLINES' : undeclared identifier
    E:\vc++\System\System.cpp(90) : error C2065: 'WHEEL_DELTA' : undeclared identifier
    Error executing cl.exe.System.exe - 4 error(s), 0 warning(s)
    错误提示是这样的.
      

  4.   

    ???已经是了?
    文件头加一行#include <winuser.h>试试
      

  5.   

    #define WM_MOUSEWHEEL   0x020A
    加上这句应该就可以了
      

  6.   

    谢谢各位前辈!
    加了这个就可以了
    #define _WIN32_WINNT 0x0500  
      

  7.   

    我都加了。但还不行啊。
    1>------ Rebuild All started: Project: 1009.pm, Configuration: Debug Win32 ------
    1>Deleting intermediate and output files for project '1009.pm', configuration 'Debug|Win32'
    1>Compiling...
    1>1009.cpp
    1>f:\c++hou\1009.pm\1009.pm\1009.cpp(48) : warning C4244: 'return' : conversion from 'WPARAM' to 'int', possible loss of data
    1>f:\c++hou\1009.pm\1009.pm\1009.cpp(82) : error C2065: 'SPI_GETWHEELSCROLLLINES' : undeclared identifier
    1>f:\c++hou\1009.pm\1009.pm\1009.cpp(87) : error C2065: 'WHEEL_DELTA' : undeclared identifier
    1>Build log was saved at "file://f:\c++hou\1009.pm\1009.pm\Debug\BuildLog.htm"
    1>1009.pm - 2 error(s), 1 warning(s)
    ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
      

  8.   

    需要高版本win支持.
    更改win的宏就可以了
      

  9.   

    有些系统提供的.h文件会先进行_WIN32_WINNT的判断,
    一般是_WIN32_WINNT>0x0400才会执行,
    因此需要手动修改_WIN32_WINNT的值,以保证所调用的函数能正确执行