在使用TrackMouseEvent函数时,编译为什么会出现“error C2065: 'TrackMouseEvent' : undeclared identifier”的错误,我已经包含了winuser.h头文件了,请各位指点指点!

解决方案 »

  1.   

    修改stdafx.h#if !defined(AFX_STDAFX_H__60E43C50_3F25_4DDA_ABD8_3B2E12505AC1__INCLUDED_)
    #define AFX_STDAFX_H__60E43C50_3F25_4DDA_ABD8_3B2E12505AC1__INCLUDED_#if _MSC_VER > 1000
    #pragma once
    #endif // _MSC_VER > 1000#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers#define _WIN32_WINNT  0x0500   // 看到了吗?把它加上就可以了。
    #include <afxwin.h>         // MFC core and standard components
    #include <afxext.h>         // MFC extensions
    #include <afxdisp.h>        // MFC Automation classes
    #include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
    #ifndef _AFX_NO_AFXCMN_SUPPORT
    #include <afxcmn.h> // MFC support for Windows Common Controls
    #endif // _AFX_NO_AFXCMN_SUPPORT
      

  2.   

    use this fucntion : _TrackMouseEvevt(LPTRACEMOUSEEVENT,lpEventTrack) will be ok.
    details please look up the MSDN.