Autor Beitrag
hathor
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mo 26.05.08 11:44 
Hi,
seit der neuen CORETEMP 0.99-Version gibt es Shared Memory.

CORETEMP gibt es hier:
www.alcpu.com/CoreTemp/

Den DELPHI-Sourcecode gibt es hier:
www.alcpu.com/forums/viewforum.php?f=36
---------------------------------------------------------------------
Sonstiges für SAMURIZE - Anhänger:

A plugin for AMD and INTEL CPUs shows CORE temperatures and more...

Hi,
since the CORETEMP-Program has the SHARED MEMORY FEATURE,
it's now easy to get all the values of CORETEMP.
SAMURIZE needs the coretemp.dll-plugin in the plugin-folder
AND the CORETEMP.exe running.
Download the plugin here:
www.samurize.com/mod...p?cid=6&lid=2188
and CORETEMP there:
www.alcpu.com/CoreTemp/

Have fun!
Tiu Hathor

Exported functions:

exports Init name 'init';
exports getparam name 'getparam';
exports core0 name 'core0';
exports core1 name 'core1';
exports core2 name 'core2';
exports core3 name 'core3';
exports ucore0 name 'ucore0';
exports ucore1 name 'ucore1';
exports ucore2 name 'ucore2';
exports ucore3 name 'ucore3';
exports CPUname name 'CPUname';
exports CPUspeed name 'CPUspeed';
exports GetCPUspeed name 'GetCPUspeed';
exports CPUmaxspeed name 'CPUmaxspeed';
exports TjMax name 'TjMax';
exports CpuCoreCount name 'CpuCoreCount';
exports CpuCount name 'CpuCount';
exports CpuVID name 'CpuVID';
exports CpuFSBSpeed name 'CpuFSBSpeed';
exports CpuMultiplier name 'CpuMultiplier';
exports Fahrenheit name 'Fahrenheit';
exports DeltaToTjMax name 'DeltaToTjMax';
exports hathor name 'hathor';
exports getinfo name 'getinfo';
exports dlltype name 'dlltype';


Zuletzt bearbeitet von hathor am Di 27.05.08 11:12, insgesamt 1-mal bearbeitet
Tilo
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 1098
Erhaltene Danke: 13

Win7 geg. WInXP oder sogar Win98
Rad2007
BeitragVerfasst: Mo 26.05.08 16:51 
Funktioniert zwar aber wie bei allen TemperaturMessProgrammen missfällt mir das sie Adminrechte brauchen. :heul :heul
hathor
Ehemaliges Mitglied
Erhaltene Danke: 1



BeitragVerfasst: Mi 28.05.08 11:32 
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
{
    Sample source code for reading CORETEMP shared memory written in Borland Delphi
    Copyright (C) 2008  Tiu Hathor

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see http://www.gnu.org/licenses/

Contact: tiu-hathor@web.de
http://www.alcpu.com/CoreTemp/developers.html
                  Arthur_Liberman@hotmail.com

}


unit CTread;

interface

uses
  Windows,
  StdCtrls,
  Controls,
  Classes,
  Forms,
  SysUtils,
  ExtCtrls;

//Core Temp shared memory Translation C++ > DELPHI : (c) 2008 Tiu Hathor
Type
  TCTInfo =  record
  uiLoad : array [0..255of Cardinal;  //256             = 1024 bytes
   uiTjMax : array [0..127of Cardinal; //128             =  512 bytes
   uiCoreCnt :Cardinal;                  // 4 bytes
   uiCPUCnt :Cardinal;                   // 4 bytes
   fTemp : array [0..255of single;     //256 *  4 bytes  = 1024 bytes
   fVID : single;                        //real   4 bytes
   fCPUSpeed : single;                   //real   4 bytes
   fFSBSpeed : single;                   //real   4 bytes
   fMultiplier : single;                 //real   4 bytes
   sCPUName : array [0..99of Char;     //String[100];    = 100 bytes
   ucFahrenheit : Boolean;               // 1 byte
   ucDeltaToTjMax: Boolean;              // 1 byte
  end;                                  // 2686  bytes

  PCTInfo   = ^TCTInfo;

  TForm1 = class(TForm)
    Timer1: TTimer;
    Memo1: TMemo;
    procedure FormShow(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);

  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
  CTInfo   : PCTInfo;
  hMapFile : Integer;

implementation

{$R *.DFM}

function ReadCTInfo : Boolean;
begin
  hMapFile :=  OpenFileMapping(FILE_MAP_READ, False, 'CoreTempMappingObject');
  if hMapFile > 0 then
  begin
    CTInfo := MapViewOfFile(hMapFile, FILE_MAP_READ, 000);
    Result := True;
  end else result := false;
  CloseHandle(hMapFile);
end;

//-----------------------------------------------------------------------------
procedure TForm1.FormShow(Sender: TObject);
begin
  Memo1.Clear;
  if ReadCTInfo = True then
  BEGIN
    Memo1.Lines.Add('CTInfo: ok');
    Timer1.Enabled:= true;
  END  else
    Memo1.Lines.Add('CTInfo: ERROR. CORETEMP is NOT running!');
end;

procedure TForm1.FormClose(Sender: TObject; var Action: TCloseAction);
begin
  UnmapViewOfFile(CTInfo);
  CloseHandle(hMapFile);
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
Memo1.Clear;

Memo1.Lines.Add('CTInfo: CpuName: '+ CTInfo.sCPUName);
Memo1.Lines.Add('');
Memo1.Lines.Add('CTInfo: Core0: '+ FloatToStr(CTInfo.fTemp[0])+ ' °C');
Memo1.Lines.Add('CTInfo: Core1: '+ FloatToStr(CTInfo.fTemp[1])+ ' °C');
Memo1.Lines.Add('CTInfo: Core2: '+ FloatToStr(CTInfo.fTemp[2])+ ' °C');
Memo1.Lines.Add('CTInfo: Core3: '+ FloatToStr(CTInfo.fTemp[3])+ ' °C');
Memo1.Lines.Add('');
Memo1.Lines.Add('CTInfo: Load-Core0: '+ IntToStr(CTInfo.uiLoad[0])+ ' %');
Memo1.Lines.Add('CTInfo: Load-Core1: '+ IntToStr(CTInfo.uiLoad[1])+ ' %');
Memo1.Lines.Add('CTInfo: Load-Core2: '+ IntToStr(CTInfo.uiLoad[2])+ ' %');
Memo1.Lines.Add('CTInfo: Load-Core3: '+ IntToStr(CTInfo.uiLoad[3])+ ' %');
Memo1.Lines.Add('');
Memo1.Lines.Add('CTInfo: TjMax: '+ IntToStr(CTInfo.uiTjMax[0])+ ' °C');
Memo1.Lines.Add('CTInfo: CpuCoreCount: '+ IntToStr(CTInfo.uiCoreCnt));
Memo1.Lines.Add('CTInfo: CpuCount: '+ IntToStr(CTInfo.uiCPUCnt));
Memo1.Lines.Add('CTInfo: CpuVID: '+ Format('%.5g', [CTInfo.fVID]) + ' Volt');
Memo1.Lines.Add('CTInfo: CpuSpeed: '+ Format('%.6g', [CTInfo.fCPUSpeed]) + ' MHz');
Memo1.Lines.Add('CTInfo: CpuFSBSpeed: '+ Format('%.3g', [CTInfo.fFSBSpeed]) + ' MHz');
Memo1.Lines.Add('CTInfo: CpuMultiplier: '+ FloatToStr(CTInfo.fMultiplier));
Memo1.Lines.Add('CTInfo: Fahrenheit: '+ BoolToStr(CTInfo.ucFahrenheit));
Memo1.Lines.Add('CTInfo: DeltaToTjMax: '+ BoolToStr(CTInfo.ucDeltaToTjMax));
end;

end.