WinAPI: GetSystemInfo - 获取系统信息

//声明:
GetSystemInfo(
  var lpSystemInfo: TSystemInfo {}
);

//TSystemInfo 是 _SYSTEM_INFO 结构的重定义:
_SYSTEM_INFO = record
  case Integer of
    0: (
      dwOemId: DWORD); {返回计算机标识符, 已废弃}
    1: (
      wProcessorArchitecture: Word;        {处理器的体系结构}
      wReserved: Word;                     {保留}
      dwPageSize: DWORD;                   {分页大小}
      lpMinimumApplicationAddress: Pointer;{最小寻址空间}
      lpMaximumApplicationAddress: Pointer;{最大寻址空间}
      dwActiveProcessorMask: DWORD;        {处理器掩码; 0..31 表示不同的处理器}
      dwNumberOfProcessors: DWORD;         {处理器数目}
      dwProcessorType: DWORD;              {处理器类型}
      dwAllocationGranularity: DWORD;      {虚拟内存空间的粒度}
      wProcessorLevel: Word;               {处理器等级}
      wProcessorRevision: Word);           {处理器版本}
end;

//举例:
procedure TForm1.FormCreate(Sender: TObject);
var
  SI: TSystemInfo;
begin
  GetSystemInfo(SI);
  Memo1.Clear;
  with Memo1.Lines do
  begin
    Add(Format('OEMID:' + #9#9 + '%d', [SI.dwOemId]));
    Add(Format('处理器体系结构:' + #9 + '%d', [SI.wProcessorArchitecture]));
    Add(Format('分页大小:' + #9 + '%d', [SI.dwPageSize]));
    Add(Format('最小寻址空间:' + #9 + '%d', [Integer(SI.lpMinimumApplicationAddress)]));
    Add(Format('最大寻址空间:' + #9 + '%d', [Integer(SI.lpMaximumApplicationAddress)]));
    Add(Format('处理器掩码:' + #9 + '%d', [SI.dwActiveProcessorMask]));
    Add(Format('处理器数目:' + #9 + '%d', [SI.dwNumberOfProcessors]));
    Add(Format('处理器类型:' + #9 + '%d', [SI.dwProcessorType]));
    Add(Format('虚拟内存粒度:' + #9 + '%d', [SI.dwAllocationGranularity]));
    Add(Format('处理器等级:' + #9 + '%d', [SI.wProcessorLevel]));
    Add(Format('处理器版本:' + #9 + '%d', [SI.wProcessorRevision]));
  end;
end;


//效果图:
r_111.png
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Win10 VS2013 ************************************************ * BOOL GetDiskSpaceInfo(LPCSTR pszDrive * 功能 根据输入的驱动器,获取磁盘总容量 * 空闲空间、簇数量等磁盘信息 * 参数 驱动器根路径,比如“D:\”。 ************************************************ * void GetTime() * 功能 获取并显示本地与系统时间 ************************************************ * void GetLang() * 功能 获取并显示系统的默认语言 ************************************************ * void ShowVersionInfo() * 功能 获取并显示系统版本信息 ************************************************ * void ShowSystemInfo() * 功能 获取并显示硬件相关信息 ************************************************ *void GetFolders() * 功能 获取系统目录等信息 ************************************************ *void WINAPI EnumProcess1() * 功能 调用EnumProcess遍历进程 * 并调用ListProcessModules1函数和 * ListProcessThreads函数列举模块 * 和线程 ************************************************ * VOID ListProcessModules1( DWORD dwPID ) * 功能 调用EnumProcessModules函数 * 列举和显示进程加载的模块 * * 参数 DWORD dwPID 进程PID ************************************************ * VOID ListProcessThreads( DWORD dwPID ) * 功能 调用Thread32First和Thread32Next * 显示一个进程的线程 * * 参数 DWORD dwPID 进程PID ************************************************ * VOID PrintError( LPTSTR msg ) * 功能 打印出错信息 * * 参数 LPTSTR msg ************************************************ * void GetDriveInfo( LPCTSTR lpRootPath) * 功能 返 回 指 定 驱 动 器 的 类 型。 * * 参数 lpRootPathName ************************************************ * void GetSystemMetric(int nIndex) * 功能 返 回 显 示 器 分 辨 率。 * * 参数 ************************************************ * void GetKeyboardInfo() * 功能 返回键盘类型。 * * 参数 *************************************************

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值