这是相关部分:
procedure THotkeyEditForm.LoadHotkeys;
var
Stream : TFileStream;
Reader : TReader;
Action : Integer;
sVersion : String;
sJMENO,
sDescription,
sAction,
sData : String;
begin
try
try
Stream := TFileStream.Create(ChangeFileExt(Application.ExeName, '.DAT'), fmOpenRead);
try
Reader := TReader.Create(Stream, 4096);
try
sVersion := Reader.ReadString;
Reader.ReadListBegin;
HotkeyList.Items.Clear;
while not Reader.EndOfList do
begin
sJMENO := Reader.ReadString;
sDescription := Reader.ReadString;
sAction := Reader.ReadString;
Action := Reader.ReadInteger;
case Action of
0,1,3,4:
sData := Reader.ReadString;
2 :
begin
sData := ReadHotkey(Reader);
end;
-1 :
begin
sDescription := '';
sAction := '';
sData := '';
end;
end;
Item := Hotkeylist.Items.Add;
Item.Caption:= sJMENO;
Item.SubItems.Add(sDescription);
Item.SubItems.Add(sAction);
Item.SubItems.Add(sData);
end;
Reader.ReadListEnd;
item := nil;
finally
Reader.Free;
end;
finally
Stream.Free;
end;
finally
end;
except
end;
end;