Zitat von
marabu:
Hi,
passenden code gibt es hier:
klick. Die Weiche für Windows/WindowsNT muss noch eingebaut werden.
Grüße vom marabu
Und hier noch ein Code, der die wirklich wichtigen Dinge (nämlich Bias in Minuten) auflistet:
procedure TForm1.Button1Click(Sender: TObject);
Delphi-Quellcode:
type
TTZI = record
Bias : Longint;
Standardbias : Longint;
Daylightbias : Longint;
Standarddate : TSystemTime;
daylightDate : TSystemTime;
end;
var
TZI : TTZI;
reg : TRegistry;
Names : TStringList;
i : integer;
BaseKey : string;
begin
Reg := TRegistry.Create(KEY_READ);
Names := TStringList.Create;
try
Reg.RootKey := HKEY_LOCAL_MACHINE;
BaseKey := 'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones';
Reg.OpenKey(BaseKey, false);
Reg.GetKeyNames(Names);
Reg.CloseKey;
FillMemory(@TZI, sizeof(TZI), 0);
StringGrid1.RowCount := 2;
StringGrid1.RowCount := 2;
StringGrid1.ColCount := 5;
StringGrid1.FixedRows := 1;
for i := 0 to Names.Count -1 do
begin
Reg.OpenKey(BaseKey+'\'+Names.Strings[i], false);
Reg.ReadBinaryData('TZI', TZI, sizeof(TZI));
if i > 0 then
StringGrid1.Rowcount := StringGrid1.RowCount+1;
StringGrid1.Cells[0,StringGrid1.RowCount-1] := Names.Strings[i];
StringGrid1.Cells[1,StringGrid1.RowCount-1] := Reg.ReadString('Display');
StringGrid1.Cells[2,StringGrid1.RowCount-1] := IntToStr(TZI.Bias);
StringGrid1.Cells[3,StringGrid1.RowCount-1] := IntToStr(TZI.StandardBias);
StringGrid1.Cells[4,StringGrid1.RowCount-1] := IntToStr(TZI.DayLightBias);
Reg.CloseKey;
end;
Reg.CloseKey;
finally
Names.Free;
Reg.Free;
end;
end;