Changeset 393 for Common/ULastOpenedList.pas
- Timestamp:
- Jul 26, 2012, 1:15:17 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/ULastOpenedList.pas
r390 r393 6 6 7 7 uses 8 Classes, SysUtils, UGeneralRegistry, Menus;8 Classes, SysUtils, Registry, URegistry, Menus; 9 9 10 10 type … … 23 23 destructor Destroy; override; 24 24 procedure LoadToMenuItem(MenuItem: TMenuItem; ClickAction: TNotifyEvent); 25 procedure LoadFromRegistry(Root: Integer; constKey: string);26 procedure SaveToRegistry(Root: Integer; constKey: string);25 procedure LoadFromRegistry(Root: HKEY; Key: string); 26 procedure SaveToRegistry(Root: HKEY; Key: string); 27 27 procedure AddItem(FileName: string); 28 28 published … … 87 87 end; 88 88 89 procedure TLastOpenedList.LoadFromRegistry(Root: Integer; constKey: string);89 procedure TLastOpenedList.LoadFromRegistry(Root: HKEY; Key: string); 90 90 var 91 91 I: Integer; 92 Registry: T GeneralRegistry;92 Registry: TRegistryEx; 93 93 FileName: string; 94 94 begin 95 Registry := T GeneralRegistry.Create(nil);95 Registry := TRegistryEx.Create; 96 96 with Registry do 97 97 try 98 CurrentRoot:= Root;98 RootKey := Root; 99 99 OpenKey(Key, True); 100 100 Items.Clear; 101 101 I := 0; 102 102 while ValueExists('File' + IntToStr(I)) and (I < MaxCount) do begin 103 if ValueExists('File' + IntToStr(I)) then 104 FileName := UTF8Encode(ReadString('File' + IntToStr(I))) 105 else FileName := ''; 103 FileName := UTF8Encode(ReadStringWithDefault('File' + IntToStr(I), '')); 106 104 if Trim(FileName) <> '' then Items.Add(FileName); 107 105 Inc(I); … … 114 112 end; 115 113 116 procedure TLastOpenedList.SaveToRegistry(Root: Integer; constKey: string);114 procedure TLastOpenedList.SaveToRegistry(Root: HKEY; Key: string); 117 115 var 118 116 I: Integer; 119 Registry: T GeneralRegistry;117 Registry: TRegistryEx; 120 118 begin 121 Registry := T GeneralRegistry.Create(nil);119 Registry := TRegistryEx.Create; 122 120 with Registry do 123 121 try 124 CurrentRoot:= Root;122 RootKey := Root; 125 123 OpenKey(Key, True); 126 124 for I := 0 to Items.Count - 1 do
Note:
See TracChangeset
for help on using the changeset viewer.