// uses ActiveX, comobj,
Procedure CPU;
const
wbemFlagForwardOnly = $00000020;
var
FSWbemLocator : OLEVariant;
FWMIService : OLEVariant;
FWbemObjectSet: OLEVariant;
FWbemObject : OLEVariant;
oEnum : IEnumvariant;
iValue : LongWord;
begin;
FSWbemLocator := CreateOleObject('
WbemScripting.SWbemLocator');
FWMIService := FSWbemLocator.ConnectServer('
localhost', '
root\cimv2', '
', '
');
FWbemObjectSet:= FWMIService.ExecQuery('
SELECT * FROM Win32_Processor','
WQL',wbemFlagForwardOnly);
oEnum := IUnknown(FWbemObjectSet._NewEnum)
as IEnumVariant;
while oEnum.Next(1, FWbemObject, iValue) = 0
do
begin
Form1.Memo1.lines.add(Format('
Processor Id : %s',[
String(FWbemObject.ProcessorId)]));
Form1.Memo1.lines.add(Format('
Max Clock Speed : %d',[Integer(FWbemObject.MaxClockSpeed)]));
Form1.Memo1.lines.add(Format('
NumberOfCores : %d', [Integer(FWbemObject.NumberOfCores)]));
Form1.Memo1.lines.add(Format('
NumberOfLogicalProcessors : %d', [Integer(FWbemObject.NumberOfLogicalProcessors)]));
//...und so weiter...:wink:
FWbemObject:=Unassigned;
end;
end;