WINVER 和 _WIN32_WINNT 請在WINDOWS.H前定義api
從 Visual C++ 2008 開始,Visual C++ 不支持面向 Windows 9五、Windows 9八、Windows ME 或 Windows NT。
若是您的 WINVER 或 _WIN32_WINNT 宏被指定到這些 Windows 版本之一,則須要修改宏。當升級從 Visual C++
的之前版本建立的項目時,若是將 WINVER 或 _WIN32_WINNT 宏指定到再也不受支持的 Windows 版本,可能會看到
與這些宏相關的編譯錯誤。ui
若要修改宏,請在頭文件中添加如下行:
#define WINVER 0x0500
#define _WIN32_WINNT 0x0500orm
=================================== =it
Minimum system required Macros to define
Win7 0x601io
Windows Server 2008 _WIN32_WINNT>=0x0600 WINVER>=0x0600
Windows Vista _WIN32_WINNT>=0x0600 WINVER>=0x0600
Windows Server 2003 _WIN32_WINNT>=0x0502 WINVER>=0x0502
Windows XP _WIN32_WINNT>=0x0501 WINVER>=0x0501
Windows 2000 _WIN32_WINNT>=0x0500 WINVER>=0x0500
Windows NT 4.0 _WIN32_WINNT>=0x0400 WINVER>=0x0400
Windows Me _WIN32_WINDOWS=0x0500 WINVER>=0x0500
Windows 98 _WIN32_WINDOWS>=0x0410 WINVER>=0x0410
Windows 95 _WIN32_WINDOWS>=0x0400 WINVER>=0x0400編譯
Windows Me _WIN32_WINDOWS=0x0490 form
=======================================
Internet Explorer 7.0 _WIN32_IE>=0x0700
Internet Explorer 6.0 SP2 _WIN32_IE>=0x0603
Internet Explorer 6.0 SP1 _WIN32_IE>=0x0601
Internet Explorer 6.0 _WIN32_IE>=0x0600
Internet Explorer 5.01, 5.5 _WIN32_IE>=0x0501
Internet Explorer 5.0, 5.0a, 5.0b _WIN32_IE>=0x0500
Internet Explorer 4.01 _WIN32_IE>=0x0401
Internet Explorer 4.0 _WIN32_IE>=0x0400
Internet Explorer 3.0, 3.01, 3.02 _WIN32_IE>=0x0300require
Internet Explorer 5.5 _WIN32_IE>=0x0550
Internet Explorer 5.01 _WIN32_IE>=0x0501im
#ifndef WINVER // 指定要求的最低平臺是 Windows Vista。
#define WINVER 0x0600 // 將此值更改成相應的值,以適用於 Windows 的其餘版本。
#endif
#ifndef _WIN32_WINNT // 指定要求的最低平臺是 Windows Vista。
#define _WIN32_WINNT 0x0600 // 將此值更改成相應的值,以適用於 Windows 的其餘版本。
#endif
//PS:0x0500 表示Windows 2000,0x0501爲Windows XP,
0x0502爲Windows Server 2003,0x0600 爲 Windows Vista。項目
=====================================
NTDDI_VERSION
Windows Server 2008 NTDDI_VERSION >= NTDDI_LONGHORN
Windows Vista NTDDI_VERSION >= NTDDI_VISTA
Windows Server 2003 SP1 NTDDI_VERSION >= NTDDI_WS03SP1
Windows Server 2003 NTDDI_VERSION >= NTDDI_WS03
Windows XP SP2 NTDDI_VERSION >= NTDDI_WINXPSP2
Windows XP SP1 NTDDI_VERSION >= NTDDI_WINXPSP1
Windows XP NTDDI_VERSION >= NTDDI_WINXP
Windows 2000 SP4 NTDDI_VERSION >= NTDDI_WIN2KSP4
Windows 2000 SP3 NTDDI_VERSION >= NTDDI_WIN2KSP3
Windows 2000 SP2 NTDDI_VERSION >= NTDDI_WIN2KSP2
Windows 2000 SP1 NTDDI_VERSION >= NTDDI_WIN2KSP1
Windows 2000 NTDDI_VERSION >= NTDDI_WIN2K
=============Shell and Common Controls Versions======= Version DLL Distribution Platform 4.0 All Microsoft Windows 95/Microsoft Windows NT 4.0. 4.7 All Microsoft Internet Explorer 3.x. 4.71 All Internet Explorer 4.0. See note 2. 4.72 All Internet Explorer 4.01 and Windows 98. See note 2. 5.0 Shlwapi.dll Internet Explorer 5. See note 3. 6.0 Shlwapi.dll Internet Explorer 6 and Windows XP. 5.0 Shell32.dll Windows 2000 and Windows Millennium Edition (Windows Me). See note 3.6.0 Shell32.dll Windows XP. 5.8 Comctl32.dll Internet Explorer 5. See note 3. 5.81 Comctl32.dll Windows 2000 and Windows Me. See note 3. 6.0 Comctl32.dll Windows XP. See note 4.