home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2004 February
/
Chip_2004-02_cd1.bin
/
zkuste
/
konfig
/
download
/
msic
/
Help
/
Int
/
MSI_CPUUsage.int
< prev
next >
Wrap
Text File
|
2003-08-26
|
2KB
|
55 lines
{*******************************************************}
{ }
{ MiTeC System Information Components }
{ CPU Usage Evaluation Component }
{ version 8.2 for Delphi 5,6 }
{ }
{ Copyright ⌐ 1997,2002 Michal Mutl }
{ }
{*******************************************************}
{$INCLUDE MITEC_DEF.INC}
unit MSI_CPUUsage;
interface
uses
SysUtils, Windows, Classes, ExtCtrls;
type
TOnIntervalEvent = procedure (Sender: TObject; Value: DWORD) of object;
TMCPUUsage = class(TComponent)
private
Timer: TTimer;
FOnInterval: TOnIntervalEvent;
FReady: Boolean;
FCPUUsage: DWORD;
function GetActive: Boolean;
function GetInterval: DWORD;
procedure SetActive(const Value: Boolean);
procedure SetInterval(const Value: DWORD);
procedure OnTimer(Sender: TObject);
function GetCPUUsage: DWORD;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property CPUUsage: DWORD read GetCPUUsage;
published
property Active: Boolean read GetActive write SetActive;
property Interval: DWORD read GetInterval write SetInterval;
property OnInterval: TOnIntervalEvent read FOnInterval write FOnInterval;
end;
function InitNTCPUData: Boolean;
function GetNTCPUData: comp;
procedure ReleaseNTCPUData;
const
ObjCounter = 'KERNEL\CPUUsage';
implementation