Api to get CPU TDP

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
13
81
www.markbetz.net
Depends on platform. In Windows you can probably get this information from the WMI object API. Google "Windows Management Interface". There are lower level hardware ports from which this kind of information can be read, but they vary from board to board.
 

JulioCesarSF

Junior Member
Mar 13, 2013
2
0
0
procedure GetKernelPerfStateInfo;
const
WbemUser ='';
WbemPassword ='';
WbemComputer ='localhost';
wbemFlagForwardOnly = $00000020;
var
FSWbemLocator : OLEVariant;
FWMIService : OLEVariant;
FWbemObjectSet: OLEVariant;
FWbemObject : OLEVariant;
oEnum : IEnumvariant;
iValue : LongWord;
begin;
FSWbemLocator := CreateOleObject('WbemScripting.SWbemLocator');
FWMIService := FSWbemLocator.ConnectServer(WbemComputer, 'root\WMI', WbemUser, WbemPassword);
FWbemObjectSet:= FWMIService.ExecQuery('SELECT * FROM KernelPerfState','WQL',wbemFlagForwardOnly);
oEnum := IUnknown(FWbemObjectSet._NewEnum) as IEnumVariant;
while oEnum.Next(1, FWbemObject, iValue) = 0 do
begin
Writeln(Format('Power %d',[Integer(FWbemObject.Power)]));// Uint32

Writeln('');
FWbemObject:=Unassigned;
end;
end;


begin
try
CoInitialize(nil);
try
GetKernelPerfStateInfo;
finally
CoUninitialize;
end;
except
on E:EOleException do
Writeln(Format('EOleException %s %x', [E.Message,E.ErrorCode]));
on E:Exception do
Writeln(E.Classname, ':', E.Message);
end;
Writeln('Press Enter to exit');
Readln;
end.

Don't show TDP. =/
 

Markbnj

Elite Member <br>Moderator Emeritus
Moderator
Sep 16, 2005
15,682
13
81
www.markbetz.net
There are tons of objects available in WMI. For example, you can also get objects for the individual processors. Not saying what you want is in there. Just suggesting that digging around might turn it up.