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