C++判断是否是Win10系统
// 判断是否是Win10系统
BOOL IsWin10System()
{
//string与CString转换
//string sPath = (LPCSTR)(CStringA)(strPath);
std::string vname;
// 先判断是否为win8.1或win10
typedef void(__stdcall*NTPROC)(DWORD*, DWORD*, DWORD*);
HINSTANCE hinst = LoadLibrary(_T("ntdll.dll"));
DWORD dwMajor, dwMinor, dwBuildNumber;
NTPROC proc = (NTPROC)GetProcAddress(hinst, "RtlGetNtVersionNumbers");
proc(&dwMajor, &dwMinor, &dwBuildNumber);
if (dwMajor == 10 && dwMinor == 0)
{
return TRUE;
}
return FALSE;
}