home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2002 March
/
Chip_2002-03_cd1.bin
/
zkuste
/
delphi
/
kompon
/
d56
/
MSYSINFO.ZIP
/
D5
/
MSystemInfo.pas
< prev
Wrap
Pascal/Delphi Source File
|
2002-01-04
|
3KB
|
117 lines
{*******************************************************}
{ }
{ MiTeC System Information Component }
{ version 7.0 for Delphi 5,6 }
{ }
{ Copyright ⌐ 1997,2002 Michal Mutl }
{ }
{*******************************************************}
{$INCLUDE MITEC_DEF.INC}
unit MSystemInfo;
interface
uses
MiTeC_PerfLibNT,
MiTeC_PerfLib9x,
MiTeC_EventLogNT,
MiTeC_Shares,
MiTeC_AccountsNT,
MiTeC_JobsNT,
MiTeC_WkstaNT,
MiTeC_ServerNT,
MiTeC_SvrAPI,
MiTeC_AdvAPI,
MiTeC_PSAPI,
MiTeC_EnumsNT,
MiTeC_Enums9x,
MiTeC_WnASPI32,
MiTeC_NetAPI32,
MiTeC_CtrlRtns,
MiTeC_Routines,
MiTeC_ToolHelp32,
MSI_Processes,
MSI_Console,
Classes,
{$IFDEF D6PLUS}
DesignIntf, DesignEditors
{$ELSE}
DsgnIntf
{$ENDIF}
;
type
TMSI_PropertyEditor = class(TStringProperty)
public
function GetAttributes: TPropertyAttributes; override;
procedure Edit; override;
end;
TMSI_ComponentEditor = class(TComponentEditor)
public
function GetVerbCount: Integer; override;
function GetVerb(Index: Integer): String; override;
procedure ExecuteVerb(Index: Integer); override;
procedure Edit; override;
end;
procedure Register;
implementation
uses MSI_GUI, MSI_CPUUsage, Forms;
procedure Register;
begin
RegisterComponents('MiTeC',[TMCPUUsage]);
RegisterComponents('MiTeC',[TMSystemInfo]);
RegisterPropertyEditor(TypeInfo(string),TMSystemInfo,'About',TMSI_PropertyEditor);
RegisterComponentEditor(TMSystemInfo,TMSI_ComponentEditor);
end;
{ TMSI_ComponentEditor }
procedure TMSI_ComponentEditor.Edit;
begin
TMSystemInfo(Self.Component).ShowModalOverviewWithAbout;
end;
procedure TMSI_ComponentEditor.ExecuteVerb(Index: Integer);
begin
if Index=0 then
Edit;
end;
function TMSI_ComponentEditor.GetVerb(Index: Integer): String;
begin
if Index=0 then
Result:='System Overview...'
else
Result:=inherited GetVerb(Index-1);
end;
function TMSI_ComponentEditor.GetVerbCount: Integer;
begin
Result:=inherited GetVerbCount+1;
end;
{ TMSI_PropertyEditor }
procedure TMSI_PropertyEditor.Edit;
begin
TMSystemInfo(Self.GetComponent(0)).ShowModalOverviewWithAbout;
end;
function TMSI_PropertyEditor.GetAttributes: TPropertyAttributes;
begin
Result:=[paDialog, paReadOnly];
end;
end.