function ReadRegString(Key: HKEY; Path, Name: String): String;
begin
Result:= EmptyStr;
with TRegistry.Create do
try
RootKey:= Key;
Access:= KEY_READ;
if OpenKey(Path,FALSE) then
begin
if ValueExists(Name) then
Result:= ReadString(Name);
end;
finally
Free;
end;
end;
ShowMessage(ReadRegString(HKEY_LOCAL_MACHINE,
'\Software\Microsoft\Windows NT\CurrentVersion\',
'RegisteredOwner'));
ShowMessage(ReadRegString(HKEY_LOCAL_MACHINE,
'\Software\Microsoft\Windows NT\CurrentVersion\',
'RegisteredOrganization'));