下午在逛cj 的时候,无意见看到的这样一段文章与代码,示例代码就不用贴出来了吧!
There are many classes to get Windows version numbers, so why another one? Briefly, because none of them offered the simplicity and low overhead that I wanted, while giving me the information I needed. Instead of writing endless standalone functions (is it XP? is it SP2?), I decided to incorporate everything into a single class.
To keep the class overhead down to a minimum, I designed a new class as a singleton, with version data retrieved and stored only once per program.
// XWinVer.h Version 1.2 // // Author: Hans Dietrich // [email protected] // // This software is released into the public domain. You are free to use // it in any way you like, except that you may not sell this source code. // // This software is provided "as is" with no expressed or implied warranty. // I accept no liability for any damage or loss of business that this // software may cause. // /////////////////////////////////////////////////////////////////////////////// #ifndef XWINVER_H #define XWINVER_H /////////////////////////////////////////////////////////////////////////////// // // version strings // #define WUNKNOWNSTR _T("unknown Windows version") #define W95STR _T("Windows 95") #define W95SP1STR _T("Windows 95 SP1") #define W95OSR2STR _T("Windows 95 OSR2") #define W98STR _T("Windows 98") #define W98SP1STR _T("Windows 98 SP1") #define W98SESTR _T("Windows 98 SE") #define WMESTR _T("Windows ME") #define WNT351STR _T("Windows NT 3.51") #define WNT4STR _T("Windows NT 4") #define W2KSTR _T("Windows 2000") #define WXPSTR _T("Windows XP") #define WVISTASTR _T("Windows Vista") #define W2003STR _T("Windows Server 2003") #define WCESTR _T("Windows CE") /////////////////////////////////////////////////////////////////////////////// // // version integer values // #define WUNKNOWN 0 #define W9XFIRST 1 #define W95 1 #define W95SP1 2 #define W95OSR2 3 #define W98 4 #define W98SP1 5 #define W98SE 6 #define WME 7 #define W9XLAST 99 #define WNTFIRST 101 #define WNT351 101 #define WNT4 102 #define W2K 103 #define WXP 104 #define W2003 105 #define WVISTA 106 #define WNTLAST 199 #define WCEFIRST 201 #define WCE 201 #define WCELAST 299 // flags returned from GetVistaProductType() #ifndef PRODUCT_BUSINESS #define PRODUCT_BUSINESS 0x00000006 // Business Edition #define PRODUCT_BUSINESS_N 0x00000010 // Business Edition #define PRODUCT_CLUSTER_SERVER 0x00000012 // Cluster Server Edition #define PRODUCT_DATACENTER_SERVER 0x00000008 // Server Datacenter Edition (full installation) #define PRODUCT_DATACENTER_SERVER_CORE 0x0000000C // Server Datacenter Edition (core installation) #define PRODUCT_ENTERPRISE 0x00000004 // Enterprise Edition #define PRODUCT_ENTERPRISE_N 0x0000001B // Enterprise Edition #define PRODUCT_ENTERPRISE_SERVER 0x0000000A // Server Enterprise Edition (full installation) #define PRODUCT_ENTERPRISE_SERVER_CORE 0x0000000E // Server Enterprise Edition (core installation) #define PRODUCT_ENTERPRISE_SERVER_IA64 0x0000000F // Server Enterprise Edition for Itanium-based Systems #define PRODUCT_HOME_BASIC 0x00000002 // Home Basic Edition #define PRODUCT_HOME_BASIC_N 0x00000005 // Home Basic Edition #define PRODUCT_HOME_PREMIUM 0x00000003 // Home Premium Edition #define PRODUCT_HOME_PREMIUM_N 0x0000001A // Home Premium Edition #define PRODUCT_HOME_SERVER 0x00000013 // Home Server Edition #define PRODUCT_SERVER_FOR_SMALLBUSINESS 0x00000018 // Server for Small Business Edition #define PRODUCT_SMALLBUSINESS_SERVER 0x00000009 // Small Business Server #define PRODUCT_SMALLBUSINESS_SERVER_PREMIUM 0x00000019 // Small Business Server Premium Edition #define PRODUCT_STANDARD_SERVER 0x00000007 // Server Standard Edition (full installation) #define PRODUCT_STANDARD_SERVER_CORE 0x0000000D // Server Standard Edition (core installation) #define PRODUCT_STARTER 0x0000000B // Starter Edition #define PRODUCT_STORAGE_ENTERPRISE_SERVER 0x00000017 // Storage Server Enterprise Edition #define PRODUCT_STORAGE_EXPRESS_SERVER 0x00000014 // Storage Server Express Edition #define PRODUCT_STORAGE_STANDARD_SERVER 0x00000015 // Storage Server Standard Edition #define PRODUCT_STORAGE_WORKGROUP_SERVER 0x00000016 // Storage Server Workgroup Edition #define PRODUCT_UNDEFINED 0x00000000 // An unknown product #define PRODUCT_ULTIMATE 0x00000001 // Ultimate Edition #define PRODUCT_ULTIMATE_N 0x0000001C // Ultimate Edition #define PRODUCT_WEB_SERVER 0x00000011 // Web Server Edition #endif /////////////////////////////////////////////////////////////////////////////// // // CXWinVersion singleton class // class CXWinVersion { // Construction public: CXWinVersion() { TRACE(_T("in CXWinVersion/n")); if (!m_bInitialized) { Init(); } else { TRACE(_T("already initialized/n")); } } // Attributes public: int GetMajorVersion() { return m_osinfo.dwMajorVersion; } int GetMinorVersion() { return m_osinfo.dwMinorVersion; } int GetBuildNumber() { return (m_osinfo.dwBuildNumber & 0xFFFF); } // needed for 9x int GetPlatformId() { return (m_osinfo.dwPlatformId); } int GetServicePackNT(); CString GetServicePackString() { return m_osinfo.szCSDVersion; } CString GetVistaProductString(); DWORD GetVistaProductType(); int GetWinVersion(); CString GetWinVersionString(); BOOL IsWin95(); BOOL IsWin98(); BOOL IsWin2KorLater(); BOOL IsWin2003(); BOOL IsWinCE(); BOOL IsXP(); BOOL IsXPorLater(); BOOL IsXPHome(); BOOL IsXPPro(); BOOL IsXPSP2(); BOOL IsMediaCenter(); BOOL IsVista(); BOOL IsVistaHome(); BOOL IsVistaBusiness(); BOOL IsVistaEnterprise(); BOOL IsVistaUltimate(); // Implementation private: void Init(); struct OSVERSIONINFOEXX { DWORD dwOSVersionInfoSize; DWORD dwMajorVersion; DWORD dwMinorVersion; DWORD dwBuildNumber; DWORD dwPlatformId; TCHAR szCSDVersion[128]; WORD wServicePackMajor; WORD wServicePackMinor; WORD wSuiteMask; BYTE wProductType; BYTE wReserved; }; static BOOL m_bInitialized; static OSVERSIONINFOEXX m_osinfo; static DWORD m_dwVistaProductType; }; /////////////////////////////////////////////////////////////////////////////// // // CXWinVersion instance // #ifndef XWINVER_CPP // include an instance in each file; the namespace insures uniqueness namespace { CXWinVersion WinVersion; } #endif #endif //XWINVER_H
// XWinVer.cpp Version 1.2 // // Author: Hans Dietrich // [email protected] // // Description: // XWinVer implements CXWinVersion, a singleton class to retrieve // the Windows OS version. Please see article at // www.codeproject.com. // // History // Version 1.1 - 2005 March 14 // - Initial public release // // Version 1.2 - 2007 June 7 // - Added IsVista(), IsVistaXXXXX() // - Added GetVistaProductString() // - Added GetVistaProductType() // - Added GetPlatformId() // - Added IsMediaCenter() // - Added IsWin95() // - Added IsWin98() // - Added IsWinCE() // // Public APIs: // NAME DESCRIPTION // --------------------- ------------------------------------------------- // GetMajorVersion() Get major version number // GetMinorVersion() Get minor version number // GetBuildNumber() Get build number (ANDed with 0xFFFF for Win9x) // GetServicePackNT() Get service pack number // GetPlatformId() Get platform id // GetServicePackString() Get service pack string // GetVistaProductString() Get Vista product string (e.g., "Business Edition") // GetVistaProductType() Get Vista product type // GetWinVersion() Get windows version (CXWinVersion code) // GetWinVersionString() Get windows version as string // IsMediaCenter() TRUE = Media Center Edition // IsWin95() TRUE = Win95 // IsWin98() TRUE = Win98 // IsWin2KorLater() TRUE = Win2000 or later // IsWin2003() TRUE = Win2003 // IsWinCE() TRUE = WinCE // IsXP() TRUE = XP // IsXPorLater() TRUE = XP or later // IsXPHome() TRUE = XP Home // IsXPPro() TRUE = XP Pro // IsXPSP2() TRUE = XP SP2 // IsVista() TRUE = Vista // IsVistaHome() TRUE = Vista Home // IsVistaBusiness() TRUE = Vista Business // IsVistaEnterprise() TRUE = Vista Enterprise // IsVistaUltimate() TRUE = Vista Ultimate // // License: // This software is released into the public domain. You are free to use // it in any way you like, except that you may not sell this source code. // // This software is provided "as is" with no expressed or implied warranty. // I accept no liability for any damage or loss of business that this // software may cause. // /////////////////////////////////////////////////////////////////////////////// #include "stdafx.h" #define XWINVER_CPP #include "XWinVer.h" // from winbase.h #ifndef VER_PLATFORM_WIN32_WINDOWS #define VER_PLATFORM_WIN32_WINDOWS 1 #endif #ifndef VER_PLATFORM_WIN32_NT #define VER_PLATFORM_WIN32_NT 2 #endif #ifndef VER_PLATFORM_WIN32_CE #define VER_PLATFORM_WIN32_CE 3 #endif // from winnt.h #ifndef VER_NT_WORKSTATION #define VER_NT_WORKSTATION 0x0000001 #endif #ifndef VER_SUITE_PERSONAL #define VER_SUITE_PERSONAL 0x00000200 #endif /////////////////////////////////////////////////////////////////////////////// /* This table has been assembled from Usenet postings, personal observations, and reading other people's code. Please feel free to add to it or correct it. dwPlatFormID dwMajorVersion dwMinorVersion dwBuildNumber 95 1 4 0 950 95 SP1 1 4 0 >950 && <=1080 95 OSR2 1 4 <10 >1080 98 1 4 10 1998 98 SP1 1 4 10 >1998 && <2183 98 SE 1 4 10 >=2183 ME 1 4 90 3000 NT 3.51 2 3 51 1057 NT 4 2 4 0 1381 2000 2 5 0 2195 XP 2 5 1 2600 2003 2 5 2 3790 Vista 2 6 0 CE 1.0 3 1 0 CE 2.0 3 2 0 CE 2.1 3 2 1 CE 3.0 3 3 0 */ /////////////////////////////////////////////////////////////////////////////// // per process data BOOL CXWinVersion::m_bInitialized = FALSE; CXWinVersion::OSVERSIONINFOEXX CXWinVersion::m_osinfo = { 0 }; DWORD CXWinVersion::m_dwVistaProductType = 0; /////////////////////////////////////////////////////////////////////////////// // Init void CXWinVersion::Init() { TRACE(_T("in CXWinVersion::Init/n")); m_dwVistaProductType = 0; ZeroMemory(&m_osinfo, sizeof(m_osinfo)); m_osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); if (GetVersionEx((LPOSVERSIONINFO) &m_osinfo)) { m_bInitialized = TRUE; if ((m_osinfo.dwPlatformId == VER_PLATFORM_WIN32_NT) && (m_osinfo.dwMajorVersion >= 5)) { // get extended version info for 2000 and later ZeroMemory(&m_osinfo, sizeof(m_osinfo)); m_osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX); GetVersionEx((LPOSVERSIONINFO) &m_osinfo); TRACE(_T("dwMajorVersion =%u/n"), m_osinfo.dwMajorVersion ); TRACE(_T("dwMinorVersion =%u/n"), m_osinfo.dwMinorVersion ); TRACE(_T("dwBuildNumber=%u/n"), m_osinfo.dwBuildNumber); TRACE(_T("suite mask=%u/n"), m_osinfo.wSuiteMask); TRACE(_T("product type=%u/n"), m_osinfo.wProductType); TRACE(_T("sp major=%u/n"), m_osinfo.wServicePackMajor); TRACE(_T("sp minor=%u/n"), m_osinfo.wServicePackMinor); } } } /////////////////////////////////////////////////////////////////////////////// // GetWinVersionString CString CXWinVersion::GetWinVersionString() { CString strVersion = WUNKNOWNSTR; int nVersion = GetWinVersion(); switch (nVersion) { default: case WUNKNOWN: break; case W95: strVersion = W95STR; break; case W95SP1: strVersion = W95SP1STR; break; case W95OSR2: strVersion = W95OSR2STR; break; case W98: strVersion = W98STR; break; case W98SP1: strVersion = W98SP1STR; break; case W98SE: strVersion = W98SESTR; break; case WME: strVersion = WMESTR; break; case WNT351: strVersion = WNT351STR; break; case WNT4: strVersion = WNT4STR; break; case W2K: strVersion = W2KSTR; break; case WXP: strVersion = WXPSTR; break; case W2003: strVersion = W2003STR; break; case WVISTA: strVersion = WVISTASTR; break; case WCE: strVersion = WCESTR; break; } return strVersion; } /////////////////////////////////////////////////////////////////////////////// // GetWinVersion int CXWinVersion::GetWinVersion() { int nVersion = WUNKNOWN; DWORD dwPlatformId = m_osinfo.dwPlatformId; DWORD dwMinorVersion = m_osinfo.dwMinorVersion; DWORD dwMajorVersion = m_osinfo.dwMajorVersion; DWORD dwBuildNumber = m_osinfo.dwBuildNumber & 0xFFFF; // Win 9x needs this if ((dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) && (dwMajorVersion == 4)) { if ((dwMinorVersion < 10) && (dwBuildNumber == 950)) { nVersion = W95; } else if ((dwMinorVersion < 10) && ((dwBuildNumber > 950) && (dwBuildNumber <= 1080))) { nVersion = W95SP1; } else if ((dwMinorVersion < 10) && (dwBuildNumber > 1080)) { nVersion = W95OSR2; } else if ((dwMinorVersion == 10) && (dwBuildNumber == 1998)) { nVersion = W98; } else if ((dwMinorVersion == 10) && ((dwBuildNumber > 1998) && (dwBuildNumber < 2183))) { nVersion = W98SP1; } else if ((dwMinorVersion == 10) && (dwBuildNumber >= 2183)) { nVersion = W98SE; } else if (dwMinorVersion == 90) { nVersion = WME; } } else if (dwPlatformId == VER_PLATFORM_WIN32_NT) { if ((dwMajorVersion == 3) && (dwMinorVersion == 51)) { nVersion = WNT351; } else if ((dwMajorVersion == 4) && (dwMinorVersion == 0)) { nVersion = WNT4; } else if ((dwMajorVersion == 5) && (dwMinorVersion == 0)) { nVersion = W2K; } else if ((dwMajorVersion == 5) && (dwMinorVersion == 1)) { nVersion = WXP; } else if ((dwMajorVersion == 5) && (dwMinorVersion == 2)) { nVersion = W2003; } else if ((dwMajorVersion == 6) && (dwMinorVersion == 0)) { nVersion = WVISTA; GetVistaProductType(); } } else if (dwPlatformId == VER_PLATFORM_WIN32_CE) { nVersion = WCE; } return nVersion; } /////////////////////////////////////////////////////////////////////////////// // GetServicePackNT - returns a valid service pack number only for NT platform int CXWinVersion::GetServicePackNT() { int nServicePack = 0; for (int i = 0; (m_osinfo.szCSDVersion[i] != _T('/0')) && (i < (sizeof(m_osinfo.szCSDVersion)/sizeof(TCHAR))); i++) { if (_istdigit(m_osinfo.szCSDVersion[i])) { nServicePack = _ttoi(&m_osinfo.szCSDVersion[i]); break; } } return nServicePack; } /////////////////////////////////////////////////////////////////////////////// // IsXP BOOL CXWinVersion::IsXP() { if (GetWinVersion() == WXP) { return TRUE; } return FALSE; } /////////////////////////////////////////////////////////////////////////////// // IsXPHome BOOL CXWinVersion::IsXPHome() { if (GetWinVersion() == WXP) { if (m_osinfo.wSuiteMask & VER_SUITE_PERSONAL) return TRUE; } return FALSE; } /////////////////////////////////////////////////////////////////////////////// // IsXPPro BOOL CXWinVersion::IsXPPro() { if (GetWinVersion() == WXP) { if ((m_osinfo.wProductType == VER_NT_WORKSTATION) && !IsXPHome()) return TRUE; } return FALSE; } /////////////////////////////////////////////////////////////////////////////// // IsXPSP2 BOOL CXWinVersion::IsXPSP2() { if (GetWinVersion() == WXP) { if (GetServicePackNT() == 2) return TRUE; } return FALSE; } #ifndef SM_MEDIACENTER #define SM_MEDIACENTER 87 #endif /////////////////////////////////////////////////////////////////////////////// // IsMediaCenter BOOL CXWinVersion::IsMediaCenter() { if (GetSystemMetrics(SM_MEDIACENTER)) return TRUE; return FALSE; } /////////////////////////////////////////////////////////////////////////////// // IsWin2003 BOOL CXWinVersion::IsWin2003() { if ((m_osinfo.dwPlatformId == VER_PLATFORM_WIN32_NT) && (m_osinfo.dwMajorVersion == 5) && (m_osinfo.dwMinorVersion == 2)) return TRUE; return FALSE; } /////////////////////////////////////////////////////////////////////////////// // GetVistaProductType DWORD CXWinVersion::GetVistaProductType() { if (m_dwVistaProductType == 0) { typedef BOOL (FAR PASCAL * lpfnGetProductInfo) (DWORD, DWORD, DWORD, DWORD, PDWORD); HMODULE hKernel32 = GetModuleHandle(_T("KERNEL32.DLL")); if (hKernel32) { lpfnGetProductInfo pGetProductInfo = (lpfnGetProductInfo) GetProcAddress(hKernel32, "GetProductInfo"); if (pGetProductInfo) pGetProductInfo(6, 0, 0, 0, &m_dwVistaProductType); } } return m_dwVistaProductType; } /////////////////////////////////////////////////////////////////////////////// // GetVistaProductString CString CXWinVersion::GetVistaProductString() { CString strProductType = _T(""); switch (m_dwVistaProductType) { case PRODUCT_BUSINESS: strProductType = _T("Business Edition"); break; case PRODUCT_BUSINESS_N: strProductType = _T("Business Edition"); break; case PRODUCT_CLUSTER_SERVER: strProductType = _T("Cluster Server Edition"); break; case PRODUCT_DATACENTER_SERVER: strProductType = _T("Server Datacenter Edition (full installation)"); break; case PRODUCT_DATACENTER_SERVER_CORE: strProductType = _T("Server Datacenter Edition (core installation)"); break; case PRODUCT_ENTERPRISE: strProductType = _T("Enterprise Edition"); break; case PRODUCT_ENTERPRISE_N: strProductType = _T("Enterprise Edition"); break; case PRODUCT_ENTERPRISE_SERVER: strProductType = _T("Server Enterprise Edition (full installation)"); break; case PRODUCT_ENTERPRISE_SERVER_CORE: strProductType = _T("Server Enterprise Edition (core installation)"); break; case PRODUCT_ENTERPRISE_SERVER_IA64: strProductType = _T("Server Enterprise Edition for Itanium-based Systems"); break; case PRODUCT_HOME_BASIC: strProductType = _T("Home Basic Edition"); break; case PRODUCT_HOME_BASIC_N: strProductType = _T("Home Basic Edition"); break; case PRODUCT_HOME_PREMIUM: strProductType = _T("Home Premium Edition"); break; case PRODUCT_HOME_PREMIUM_N: strProductType = _T("Home Premium Edition"); break; case PRODUCT_HOME_SERVER: strProductType = _T("Home Server Edition"); break; case PRODUCT_SERVER_FOR_SMALLBUSINESS: strProductType = _T("Server for Small Business Edition"); break; case PRODUCT_SMALLBUSINESS_SERVER: strProductType = _T("Small Business Server"); break; case PRODUCT_SMALLBUSINESS_SERVER_PREMIUM: strProductType = _T("Small Business Server Premium Edition"); break; case PRODUCT_STANDARD_SERVER: strProductType = _T("Server Standard Edition (full installation)"); break; case PRODUCT_STANDARD_SERVER_CORE: strProductType = _T("Server Standard Edition (core installation)"); break; case PRODUCT_STARTER: strProductType = _T("Starter Edition"); break; case PRODUCT_STORAGE_ENTERPRISE_SERVER: strProductType = _T("Storage Server Enterprise Edition"); break; case PRODUCT_STORAGE_EXPRESS_SERVER: strProductType = _T("Storage Server Express Edition"); break; case PRODUCT_STORAGE_STANDARD_SERVER: strProductType = _T("Storage Server Standard Edition"); break; case PRODUCT_STORAGE_WORKGROUP_SERVER: strProductType = _T("Storage Server Workgroup Edition"); break; case PRODUCT_UNDEFINED: strProductType = _T("An unknown product"); break; case PRODUCT_ULTIMATE: strProductType = _T("Ultimate Edition"); break; case PRODUCT_ULTIMATE_N: strProductType = _T("Ultimate Edition"); break; case PRODUCT_WEB_SERVER: strProductType = _T("Web Server Edition"); break; default: break; } return strProductType; } /////////////////////////////////////////////////////////////////////////////// // IsVista BOOL CXWinVersion::IsVista() { if (GetWinVersion() == WVISTA) { return TRUE; } return FALSE; } /////////////////////////////////////////////////////////////////////////////// // IsVistaHome BOOL CXWinVersion::IsVistaHome() { if (GetWinVersion() == WVISTA) { switch (m_dwVistaProductType) { case PRODUCT_HOME_BASIC: case PRODUCT_HOME_BASIC_N: case PRODUCT_HOME_PREMIUM: case PRODUCT_HOME_PREMIUM_N: case PRODUCT_HOME_SERVER: return TRUE; } } return FALSE; } /////////////////////////////////////////////////////////////////////////////// // IsVistaBusiness BOOL CXWinVersion::IsVistaBusiness() { if (GetWinVersion() == WVISTA) { switch (m_dwVistaProductType) { case PRODUCT_BUSINESS: case PRODUCT_BUSINESS_N: return TRUE; } } return FALSE; } /////////////////////////////////////////////////////////////////////////////// // IsVistaEnterprise BOOL CXWinVersion::IsVistaEnterprise() { if (GetWinVersion() == WVISTA) { switch (m_dwVistaProductType) { case PRODUCT_ENTERPRISE: case PRODUCT_ENTERPRISE_N: case PRODUCT_ENTERPRISE_SERVER: case PRODUCT_ENTERPRISE_SERVER_CORE: case PRODUCT_ENTERPRISE_SERVER_IA64: return TRUE; } } return FALSE; } /////////////////////////////////////////////////////////////////////////////// // IsVistaUltimate BOOL CXWinVersion::IsVistaUltimate() { if (GetWinVersion() == WVISTA) { switch (m_dwVistaProductType) { case PRODUCT_ULTIMATE: case PRODUCT_ULTIMATE_N: return TRUE; } } return FALSE; } /////////////////////////////////////////////////////////////////////////////// // IsWin2KorLater BOOL CXWinVersion::IsWin2KorLater() { if ((m_osinfo.dwPlatformId == VER_PLATFORM_WIN32_NT) && (m_osinfo.dwMajorVersion >= 5)) return TRUE; return FALSE; } /////////////////////////////////////////////////////////////////////////////// // IsXPorLater BOOL CXWinVersion::IsXPorLater() { if ((m_osinfo.dwPlatformId == VER_PLATFORM_WIN32_NT) && (((m_osinfo.dwMajorVersion == 5) && (m_osinfo.dwMinorVersion > 0)) || (m_osinfo.dwMajorVersion > 5))) return TRUE; return FALSE; } /////////////////////////////////////////////////////////////////////////////// // IsWin95 BOOL CXWinVersion::IsWin95() { if ((m_osinfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) && (m_osinfo.dwMajorVersion == 4) && (m_osinfo.dwMinorVersion < 10)) return TRUE; return FALSE; } /////////////////////////////////////////////////////////////////////////////// // IsWin98 BOOL CXWinVersion::IsWin98() { if ((m_osinfo.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS) && (m_osinfo.dwMajorVersion == 4) && (m_osinfo.dwMinorVersion >= 10)) return TRUE; return FALSE; } /////////////////////////////////////////////////////////////////////////////// // IsWinCE BOOL CXWinVersion::IsWinCE() { return (GetWinVersion() == WCE); }