关于targetver.h文件

来源:互联网 发布:船舶装载软件 编辑:程序博客网 时间:2024/05/17 07:14

Copy From:   http://blog.csdn.net/friendan/article/details/7668884


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×0501Windows XP

0×0502Windows Server 2003

0×0600  Windows Vista

实际使用截图如下;



0 0
原创粉丝点击