thank u

解决方案 »

  1.   

    BOOL GetVersionEx(
      LPOSVERSIONINFO lpVersionInfo // version information
    );
    Parameters
    lpVersionInfo 
    [in/out] Pointer to an OSVERSIONINFO data structure that the function fills with operating system version information. 
    Before calling the GetVersionEx function, set the dwOSVersionInfoSize member of the OSVERSIONINFO data structure to sizeof(OSVERSIONINFO). 
    typedef struct _OSVERSIONINFO{ 
      DWORD dwOSVersionInfoSize; 
      DWORD dwMajorVersion; 
      DWORD dwMinorVersion; 
      DWORD dwBuildNumber; 
      DWORD dwPlatformId; 
      TCHAR szCSDVersion[ 128 ]; 
    } OSVERSIONINFO; 
      

  2.   

    CString GetSystemVersion()
    {
    CString strSystemVersion="";
    DWORD dwVersion = GetVersion(); 
    // Get the Windows version. 
    DWORD dwWindowsMajorVersion = (DWORD)(LOBYTE(LOWORD(dwVersion))); 
    DWORD dwWindowsMinorVersion = (DWORD)(HIBYTE(LOWORD(dwVersion))); 
    // Get the build number for Windows NT/Windows 2000 or Win32s. 
    if (dwVersion < 0x80000000) // Windows NT/2000 
    strSystemVersion.Format("Windows NT/2000 %ld", (DWORD)(HIWORD(dwVersion)) ); 
    else if (dwWindowsMajorVersion < 4) // Win32s 
    strSystemVersion.Format("Win32s %ld", (DWORD)(HIWORD(dwVersion) & ~0x8000) ); 
    else // Windows 95/98 -- No build number 
    strSystemVersion.Format("Windows 95/98");
    return  strSystemVersion;
    }