#include "StdAfx.h" #include "Utils.h" using namespace ATL; //////////////////////////////////////////////////////////////////////////////// // bool IsVistaOrHigher() { OSVERSIONINFOEX osVersionInfo; ::ZeroMemory(&osVersionInfo, sizeof(OSVERSIONINFOEX)); osVersionInfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); osVersionInfo.dwMajorVersion = 6; ULONGLONG maskCondition = ::VerSetConditionMask(0, VER_MAJORVERSION, VER_GREATER_EQUAL); return (::VerifyVersionInfo(&osVersionInfo, VER_MAJORVERSION, maskCondition) == TRUE); //const DWORD dwVersion = ::GetVersion(); //const DWORD dwMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion))); //return dwMajorVersion >= 6; // Vista or higher } ////////////////////////////////////////////////////////////////////////////////