📄 unit25.pas
字号:
unit Unit25;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
type
TFormCPUInformation = class(TForm)
GroupBox1: TGroupBox;
Label1: TLabel;
LabeldwOemId: TLabel;
LabelwProcessorArchitecture: TLabel;
Label2: TLabel;
Label3: TLabel;
LabelwReserved: TLabel;
LabeldwPageSize: TLabel;
Label5: TLabel;
Label7: TLabel;
LabeldwActiveProcessorMask: TLabel;
LabeldwNumberOfProcessors: TLabel;
Label9: TLabel;
Label11: TLabel;
LabeldwProcessorType: TLabel;
LabeldwAllocationGranularity: TLabel;
Label13: TLabel;
Label4: TLabel;
LabelwProcessorLevel: TLabel;
LabelwProcessorRevision: TLabel;
Label10: TLabel;
LabelPriority: TLabel;
Label8: TLabel;
Label6: TLabel;
LabelThreadPriority: TLabel;
procedure CPUInformation(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FormCPUInformation: TFormCPUInformation;
implementation
{$R *.dfm}
procedure TFormCPUInformation.CPUInformation(Sender: TObject);
var
ipSystemInfo: _system_info;
iVar: cardinal;
jVar: word;
begin
getsystemInfo(ipSystemInfo);
ivar:=ipSystemInfo.dwOemId;
LabeldwOemId.Caption:= inttostr(iVar);
jvar:=ipSystemInfo.wProcessorArchitecture;
if jvar=0 then
LabelwProcessorArchitecture.Caption:= ' 架构代码 '+inttostr(jVar)+', 英特尔32位架构 '
else
LabelwProcessorArchitecture.Caption:= ' 架构代码 '+inttostr(jVar);
jvar:=ipSystemInfo.wReserved;
LabelwReserved.Caption:= inttostr(jVar);
ivar:=ipSystemInfo.dwPageSize;
LabeldwPageSize.Caption:= inttostr(iVar)+' 字节 ';
ivar:=ipSystemInfo.dwActiveProcessorMask;
LabeldwActiveProcessorMask.Caption:= inttostr(iVar);
ivar:=ipSystemInfo.dwNumberOfProcessors;
LabeldwNumberOfProcessors.Caption:= inttostr(iVar)+' 颗内核处理器 ';
ivar:=ipSystemInfo.dwProcessorType;
LabeldwProcessorType.Caption:= inttostr(iVar)+' 系列 ';
ivar:=ipSystemInfo.dwAllocationGranularity;
LabeldwAllocationGranularity.Caption:= inttostr(iVar)+' 字节 ';
jvar:=ipSystemInfo.wProcessorLevel;
LabelwProcessorLevel.Caption:= inttostr(jVar)+' 种优先级 ';
jvar:= GetPriorityClass(GetCurrentProcess);
LabelPriority.Caption:= ' 第 '+inttostr(jVar)+' 位 ';
jvar:= GetThreadPriority(GetCurrentThread)+1;
LabelThreadPriority.Caption:= ' 第 '+inttostr(jVar)+' 位 ';
jvar:=ipSystemInfo.wProcessorRevision;
LabelwProcessorRevision.Caption:= ' 第 '+inttostr(jVar)+' 版 ';
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -