Lv.的博客

关于VS2008中的targetver.h文件

 

targerver.h文件的作用:

定义程序运行的环境,如限制程序只能在XP下运行,限制程序在只能在Vin7下运行

或限制程序只能在XP以上系统运行,或限制程序只能在Server2003以上系统运行...

 

用法:

 

#ifndef WINVER                	  //程序中没有定义WINVER宏时
#define WINVER 0x0600            // 定义WINVER为0x0600    //0x0600表示Windows Vista
#endif
 #ifndef _WIN32_WINNT                // 程序中没有定义_WIN32_WINNT宏时
#define _WIN32_WINNT 0x0600     // 定义_WIN32_WINNT为0x0600    //0x0600表示Windows Vista
#endif

 

附:

0×0500 表示Windows 2000,

0×0501为Windows XP,

0×0502为Windows Server 2003,

0×0600 为 Windows Vista。

实际使用截图如下;

 

posted @ 2015-04-21 10:46  Avatarx  阅读(384)  评论(0编辑  收藏  举报