Check Windows version

前端 未结 7 1671
梦如初夏
梦如初夏 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:13

    In Visual Studio 2013 or higher, you can also use the new Version Helper functions.

    There are methods for many different Windows versions. Example:

    #include 
    
    if (!IsWindowsVistaOrGreater())
    {
       MessageBox(NULL, "You need at least Windows Vista", "Version Not Supported", MB_OK);
    }
    

    More information here

提交回复
热议问题