威望0
积分7946
贡献0
在线时间763 小时
UID1
注册时间2021-4-14
最后登录2024-11-21
管理员
- UID
- 1
- 威望
- 0
- 积分
- 7946
- 贡献
- 0
- 注册时间
- 2021-4-14
- 最后登录
- 2024-11-21
- 在线时间
- 763 小时
|
[mw_shl_code=cpp,true]//
// Provided by Chilkat Software, Inc. (http://www.chilkatsoft.com)
//
// Makers of ActiveX and .NET components:
//
// Zip Compression Component
// Email Component
// Encryption Component
// S/MIME Component
// HTML Email Component
// Character Encoding Conversion Component
// FTP Component (Free)
// Super-Fast XML Parser Component (Free)
// ASP Email Component
// ASP Super-Fast XML Parser Component (Free)
// Free SSL Component (Free)
// Real-time Compression Component (Free)
// DirectX Game Development C++ Library (Free, Open Source)
// XML Messaging Component
// EXE Stuffer Component (Embed anything in an EXE)
// Digital Certificates Component (Free)
// "Mail This Page!" utility (Free)
// Zip 2 Secure EXE (Free) for creating self-extracting EXEs
//
// WindowsVersion.h: interface for the WindowsVersion class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_WINDOWSVERSION_H__5AE736F3_769F_46E9_BB6E_23749CFA06EB__INCLUDED_)
#define AFX_WINDOWSVERSION_H__5AE736F3_769F_46E9_BB6E_23749CFA06EB__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class WindowsVersion
{
private:
OSVERSIONINFO m_info;
public:
WindowsVersion();
virtual ~WindowsVersion();
bool isWindows95(void);
bool isWindows98(void);
bool isWindowsME(void);
bool isWindowsXP(void);
bool isWindows2000(void);
bool isWindowsNT4(void);
};
#endif // !defined(AFX_WINDOWSVERSION_H__5AE736F3_769F_46E9_BB6E_23749CFA06EB__INCLUDED_)[/mw_shl_code]
[mw_shl_code=cpp,true]//
// Provided by Chilkat Software, Inc. (http://www.chilkatsoft.com)
//
// Makers of ActiveX and .NET components:
//
// Zip Compression Component
// Email Component
// Encryption Component
// S/MIME Component
// HTML Email Component
// Character Encoding Conversion Component
// FTP Component (Free)
// Super-Fast XML Parser Component (Free)
// ASP Email Component
// ASP Super-Fast XML Parser Component (Free)
// Free SSL Component (Free)
// Real-time Compression Component (Free)
// DirectX Game Development C++ Library (Free, Open Source)
// XML Messaging Component
// EXE Stuffer Component (Embed anything in an EXE)
// Digital Certificates Component (Free)
// "Mail This Page!" utility (Free)
// Zip 2 Secure EXE (Free) for creating self-extracting EXEs
//
// WindowsVersion.cpp: implementation of the WindowsVersion class.
//
//////////////////////////////////////////////////////////////////////
#include <windows.h>
#include "WindowsVersion.h"
WindowsVersion::WindowsVersion()
{
m_info.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&m_info);
}
WindowsVersion::~WindowsVersion()
{
}
bool WindowsVersion::isWindows95(void)
{
if (m_info.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS)
{
return false;
}
return m_info.dwMinorVersion == 0;
}
bool WindowsVersion::isWindows98(void)
{
if (m_info.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS)
{
return false;
}
return m_info.dwMinorVersion == 10;
}
bool WindowsVersion::isWindowsME(void)
{
if (m_info.dwPlatformId != VER_PLATFORM_WIN32_WINDOWS)
{
return false;
}
return m_info.dwMinorVersion == 90;
}
bool WindowsVersion::isWindowsXP(void)
{
if (m_info.dwPlatformId != VER_PLATFORM_WIN32_NT)
{
return false;
}
return m_info.dwMajorVersion == 5 && m_info.dwMinorVersion >= 1;
}
bool WindowsVersion::isWindows2000(void)
{
if (m_info.dwPlatformId != VER_PLATFORM_WIN32_NT)
{
return false;
}
return m_info.dwMajorVersion == 5 && m_info.dwMinorVersion == 0;
}
bool WindowsVersion::isWindowsNT4(void)
{
if (m_info.dwPlatformId != VER_PLATFORM_WIN32_NT)
{
return false;
}
return m_info.dwMajorVersion == 4;
}[/mw_shl_code] |
|