Check Windows version

2019-01-18 09:15发布

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

7条回答
小情绪 Triste *
2楼-- · 2019-01-18 09:40

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 <VersionHelpers.h>

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

More information here

查看更多
登录 后发表回答