function RegGetValueNames(const RootKey: Integer; const SubKeyName: String; var Names: TArrayOfString): Boolean;
Opens the specified registry key and reads the names of its values into the specified string array Names. Returns True if successful, False otherwise.
var
Names: TArrayOfString;
S: String;
begin
if RegGetValueNames(HKEY_CURRENT_USER, 'Control Panel\Mouse', Names) then
begin
S := StringJoin(#13#10, Names);
MsgBox('List of values:'#13#10#13#10 + S, mbInformation, MB_OK);
end else
begin
// add any code to handle failure here
end;
end;