Bonjour
Pour convertir un string en HKEY j'utilise ceci
Existe-t-il une fonction pour convertir directement du style StrToHkey ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 function aRegistry(CleRoot:string):boolean; var cle : Cardinal; Reg : TRegistry; begin if CleRoot = 'HKEY_CLASSES_ROOT' then cle := HKEY_CLASSES_ROOT else if CleRoot = 'HKEY_CURRENT_USER' then cle := HKEY_CURRENT_USER else if CleRoot = 'HKEY_LOCAL_MACHINE' then cle := HKEY_LOCAL_MACHINE else if CleRoot = 'HKEY_USERS' then cle := HKEY_USERS else if CleRoot = 'HKEY_CURRENT_CONFIG' then cle := HKEY_CURRENT_CONFIG try Reg := TRegistry.Create; Reg.RootKey := cle; ... end;
Partager