Hi, so gäbe es etwas weniger Probleme mit der Sichtbarkeit usw... ist aber auch noch nicht so toll, weil sehr speziell.
Delphi-Quellcode:
unit PDHThread;
interface
{...}
TPDHThreadEvent =
class(TObject)
private
FUsage: Double;
FCPUIndex: Integer;
public
constructor Create(Info: TPDHInfo; CPUIndex: Integer);
published
property Usage: Double
read FUsage
write FUsage;
property CPUIndex: Integer
read FCPUIndex
write FCPUIndex;
end;
{...}
implementation
{...}
procedure TPDHThread.UpdatePDH;
var I: Integer;
Event: TPDHThreadEvent;
begin
for I := Low(PDHInfo)
to High(PDHInfo)
do begin
try
Event := TPDHThreadEvent.Create(PDHInfo[i], i);
MainForm.UpdatePDH(Event);
finally
Event.Free;
end;
end;
end;
{ TPDHThreadEvent }
constructor TPDHThreadEvent.Create(Info: TPDHInfo; CPUIndex: Integer);
begin
inherited Create;
FUsage := Info.PDHLoad.doubleValue;
FCPUIndex := CPUIndex;
end;
end.
Dani H.
At Least I Can Say I Tried