Windows Win32 C/C++ プログラム実行環境指定マクロ値について( ..)φメモメモ

----- WINVER, _WIN32_WINNT, _WIN32_WINDOWS -----

Windows 95
WINVER=0x0400 _WIN32_WINDOWS=0x0400

Windows 98
WINVER=0x0410 _WIN32_WINDOWS=0x0410

Windows Me
WINVER=0x0500 _WIN32_WINDOWS=0x0500

Windows NT 4.0
WINVER=0x0400 _WIN32_WINNT=0x0400

Windows 2000
WINVER=0x0500 _WIN32_WINNT=0x0500

Windows XP
WINVER=0x0501 _WIN32_WINNT=0x0501

Windows Server 2003 family
WINVER=0x0502 _WIN32_WINNT=0x0502

----- WIN32_IE -----

Windows 95, Windows NT 4.0 (Comctl32.dll 4.00, Shell32.dll 4.00)
WIN32_IE=0x0200

Internet Explorer 3.0, 3.01, 3.02
WIN32_IE=0x0300

Internet Explorer 4.0
WIN32_IE=0x0400

Internet Explorer 4.01
_WIN32_IE=0x0401

Internet Explorer 5.0, 5.0a, 5.0b
_WIN32_IE=0x0500

Internet Explorer 5.01, 5.5
_WIN32_IE=0x0501

Internet Explorer 5.6
_WIN32_IE=0x0560

Internet Explorer 6.0
_WIN32_IE=0x0600
 
 
( 参照 URL http://msdn.microsoft.com/library/shared/deeptree/asp/rightframe.asp?dtcfg=/library/deeptreeconfig.xml&;;;;;url=/library/en-us/winprog/winprog/using_the_windows_headers.asp?frame=true&hidetoc=false )
 
 
●処理系デフォルトマクロ値チェック コンソールプログラム●

実際にコンパイルする場合は下記の作業を行う必要があります。
全角"<"文字を、全て半角文字に変更する。
全角">"文字を、全て半角文字に変更する。
全角","文字を、全て半角文字に変更する。
全角"%"文字を、全て半角文字に変更する。
全角スペース文字を、全て半角スペース文字に変更するか又は削除する。

--
#include <windows.h>
#include <stdio.h>

int main(void)
{
#if defined WINVER
  printf("WINVER     = 0x%04X\n", WINVER);
#else
  printf("WINVER 未定義\n");
#endif
#if defined _WIN32_WINNT
  printf("_WIN32_WINNT  = 0x%04X\n", _WIN32_WINNT);
#else
  printf("_WIN32_WINNT 未定義\n");
#endif
#if defined _WIN32_WINDOWS
  printf("_WIN32_WINDOWS = 0x%04X\n", _WIN32_WINDOWS);
#else
  printf("_WIN32_WINDOWS 未定義\n");
#endif
#if defined _WIN32_IE
  printf("_WIN32_IE   = 0x%04X\n", _WIN32_IE);
#else
  printf("_WIN32_IE 未定義\n" );
#endif

  return 0;
}
--

<CudeWarrior 8.0 実行結果>

WINVER     = 0x0400
_WIN32_WINNT 未定義
_WIN32_WINDOWS 未定義
_WIN32_IE   = 0x0501

<Borland C++ 5.3 実行結果>

WINVER     = 0x0400
_WIN32_WINNT  = 0x0400
_WIN32_WINDOWS 未定義
_WIN32_IE   = 0x0400

<Borland C++ 5.5.1 実行結果>

WINVER     = 0x0500
_WIN32_WINNT  = 0x0500
_WIN32_WINDOWS 未定義
_WIN32_IE   = 0x0501

<Visual C++ 5.0 Learning Edition 実行結果>

WINVER     = 0x0400
_WIN32_WINNT 未定義
_WIN32_WINDOWS 未定義
_WIN32_IE 未定義

<Visual C++ 6.0 Standard Edition 実行結果>
WINVER     = 0x0400
_WIN32_WINNT 未定義
_WIN32_WINDOWS 未定義
_WIN32_IE   = 0x0400

<Visual C++.net Standard 2003 実行結果>
WINVER     = 0x0501
_WIN32_WINNT 未定義
_WIN32_WINDOWS 未定義
_WIN32_IE   = 0x0501

コメント