我程序的部分代码:
#include <Winable.h>INPUT intMsg[2];
intMsg[0].type = INPUT_KEYBOARD;
intMsg[0].ki.dwFlags = KEYEVENTF_UNICODE;  //报错
intMsg[0].ki.wVk = 0;error C2065: 'KEYEVENTF_UNICODE' : undeclared identifier
还有个问题:
  intMsg[0].ki.wScan = (可以直接赋个CString型的吗?)

解决方案 »

  1.   

    在头文件里添加
    #define _WIN32_WINNT 0x0500
      

  2.   

    请问在哪个头文件中加?
    我试了在我整个程序中的四个头文件中分别加上这句定义,只有在stdAfx.h中定义时没有150多个错,不过它还是有这句:error C2065: 'KEYEVENTF_UNICODE' : undeclared identifier
    我真拿它没办法!
      

  3.   

    问题我解决了:  
           如果要提高操作系统的版本,可以定义#define  _WIN32_WINNT  0x0500,在stdAfx.h中定义  
    但这个还是不能去掉error  C2065:  'KEYEVENTF_UNICODE'  :  undeclared  identifier这个错误,  
    我直接在程序中用0x4代替'KEYEVENTF_UNICODE'  ,因为它在编译的时候是用这个值来运行的。