Check Windows version

前端 未结 7 1700
梦如初夏
梦如初夏 2020-12-09 15:34

How I can check in C++ if Windows version installed on computer is Windows Vista and higher (Windows 7)?

7条回答
  •  被撕碎了的回忆
    2020-12-09 16:05

    This Microsoft support page gives you details for older versions.

    To determine the operating system that is running on a given system, the following data is needed:

                  95  98  ME  NT 4  2000  XP
    PlatformID    1   1   1   2     2     2
    Major version 4   4   4   4     5     5
    Minor version 0   10  90  0     0     1
    

    You could implement the code and run it on a Vista and Windows-7 machine to check the values returned.

    To get the operating system version information make the following call:

    System::OperatingSystem *osInfo = System::Environment::OSVersion;
    

提交回复
热议问题