Changeset 371 for Common/URegistry.pas
- Timestamp:
- Jun 1, 2012, 10:15:16 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Common/URegistry.pas
r328 r371 6 6 7 7 uses 8 Registry;8 Classes, Registry; 9 9 10 10 type 11 12 { TRegistryEx } 13 11 14 TRegistryEx = class(TRegistry) 12 15 private … … 18 21 function ReadFloatWithDefault(const Name: string; 19 22 DefaultValue: Double): Double; 23 function DeleteKeyRecursive(const Key: string): Boolean; 20 24 end; 21 25 … … 54 58 end; 55 59 60 function TRegistryEx.DeleteKeyRecursive(const Key: string): Boolean; 61 var 62 SubKeys: TStringList; 63 I: Integer; 64 begin 65 try 66 SubKeys := TStringList.Create; 67 if OpenKey(Key, False) and HasSubKeys then begin 68 GetKeyNames(SubKeys); 69 for I := 0 to SubKeys.Count - 1 do 70 DeleteKeyRecursive(Key + '\' + SubKeys[I]); 71 end; 72 Result := DeleteKey(Key); 73 finally 74 SubKeys.Free; 75 end; 76 end; 77 56 78 function TRegistryEx.ReadBoolWithDefault(const Name: string; 57 79 DefaultValue: Boolean): Boolean;
Note:
See TracChangeset
for help on using the changeset viewer.