Cita:
Empezado por KnoX_RuS
Humm el code parece estar bien del todo pero me sige dando llave no encontrada cuando esa llave si existe en cualquier windows 7.
saludos.
|
Hola.
La verdad no puedo decir nada por que no tengo Windows 7, pero hice esta prueba que funciona sin problemas:
Código Delphi
[-]
uses Registry;
procedure TForm1.Button1Click(Sender: TObject);
const
AKEY: array[0..1] of string=('Software\Microsoft\Windows\CurrentVersion', 'Software\Microsoft\Windows\CurrentVerXXXX'); var
v: Integer;
r: TRegistry;
begin
Randomize;
v:= Random(2);
with TRegistry.Create do
try
RootKey:= HKEY_CURRENT_USER;
if KeyExists(AKEY[v]) then
MessageBoxA(0,PChar(AKEY[v]+': Encontrada'),'Bien', 64)
else
MessageBoxA(0,PChar(AKEY[v]+': No existe'),'Mal', 64);
finally
Free;
end;
end;
Un saludo.