CheckWin32Version - C++ Builder

C++ Builder 参考手册System::SysutilsCheckWin32Version


操作系统的版本是否大于等于参数给定的值。

头文件:#include <System.SysUtils.hpp>
命名空间:System::Sysutils
函数原型:

bool __fastcall CheckWin32Version(int AMajor, int AMinor = 0);

参数:

  • AMajor:操作系统主版本号;
  • AMinor:操作系统次版本号;

返回值:

  • true:操作系统版本大于等于参数给定的值;
  • false:操作系统版本小于参数给定的值。
操作系统 版本号
Windows 11 10.0 *
Windows 10 10.0
Windows 8.1 6.3
Windows Server 2012 R2 6.3
Windows 8 6.2
Windows Server 2012 6.2
Windows 7 6.1
Windows Server 2008 R2 6.1
Windows Server 2008 6.0
Windows Vista 6.0
Windows Server 2003 R2 5.2
Windows Server 2003 5.2
Windows XP 5.1
Windows 2000 5.0
Windows ME 4.90
Windows NT 4 4.0
Windows 9x 4.0
Windows NT 3.51 3.51
Windows NT 3.5 3.5

* Windows 11 目前还没发布正式版本,Insider Preview 版本一直是 10.0,正式版也没有升级版本号的迹象


例:

void __fastcall TForm1::Button1Click(TObject *Sender)
{
    if(!CheckWin32Version(6,0))
    {
        ShowMessage(L"需要 Vista 及更新的操作系统运行!");
        return;
    }
    ShowMessage(L"操作系统满足要求。");
}

相关:

  • System::Sysutils::Win32MajorVersion
  • System::Sysutils::Win32MinorVersion
  • System::Sysutils::Win32BuildNumber
  • System::Sysutils::Win32CSDVersion
  • System::Sysutils::Win32Platform
  • System::Sysutils::RaiseLastOSError
  • System::Sysutils::CheckOSError
  • System::Sysutils::Win32Check
  • System::Sysutils::ShowException
  • System::Sysutils::ExceptionErrorMessage
  • System::Sysutils::OutOfMemoryError
  • System::Sysutils::Abort
  • System::Sysutils::EAbort
  • System::Sysutils
  • Vcl::Forms::TApplication::ShowException

C++ Builder 参考手册System::SysutilsCheckWin32Version

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

友情链接更多精彩内容