Changeset 192 for trunk/Packages/Common/URegistry.pas
- Timestamp:
- May 1, 2018, 10:18:03 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/Common/URegistry.pas
r43 r192 9 9 10 10 type 11 TRegistryRoot = (rrKeyClassesRoot = HKEY($80000000), 12 rrKeyCurrentUser = HKEY($80000001), 13 rrKeyLocalMachine = HKEY($80000002), 14 rrKeyUsers = HKEY($80000003), 15 rrKeyPerformanceData = HKEY($80000004), 16 rrKeyCurrentConfig = HKEY($80000005), 17 rrKeyDynData = HKEY($80000006)); 11 TRegistryRoot = (rrKeyClassesRoot, rrKeyCurrentUser, rrKeyLocalMachine, 12 rrKeyUsers, rrKeyPerformanceData, rrKeyCurrentConfig, rrKeyDynData); 18 13 19 14 { TRegistryContext } … … 23 18 Key: string; 24 19 class operator Equal(A, B: TRegistryContext): Boolean; 20 function Create(RootKey: TRegistryRoot; Key: string): TRegistryContext; overload; 21 function Create(RootKey: HKEY; Key: string): TRegistryContext; overload; 25 22 end; 26 23 … … 43 40 end; 44 41 45 function RegContext(RootKey: HKEY; Key: string): TRegistryContext; 46 42 const 43 RegistryRootHKEY: array[TRegistryRoot] of HKEY = (HKEY_CLASSES_ROOT, 44 HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS, HKEY_PERFORMANCE_DATA, 45 HKEY_CURRENT_CONFIG, HKEY_DYN_DATA); 47 46 48 47 implementation 49 48 50 function RegContext(RootKey: HKEY; Key: string): TRegistryContext;51 begin52 Result.RootKey := RootKey;53 Result.Key := Key;54 end;55 49 56 50 { TRegistryContext } … … 59 53 begin 60 54 Result := (A.Key = B.Key) and (A.RootKey = B.RootKey); 55 end; 56 57 function TRegistryContext.Create(RootKey: TRegistryRoot; Key: string): TRegistryContext; 58 begin 59 Result.RootKey := RegistryRootHKEY[RootKey]; 60 Result.Key := Key; 61 end; 62 63 function TRegistryContext.Create(RootKey: HKEY; Key: string): TRegistryContext; 64 begin 65 Result.RootKey := RootKey; 66 Result.Key := Key; 61 67 end; 62 68
Note:
See TracChangeset
for help on using the changeset viewer.