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; I: Integer; S: String; begin if RegGetValueNames(HKEY_CURRENT_USER, 'Control Panel\Mouse', Names) then begin S := ''; for I := 0 to GetArrayLength(Names)-1 do S := S + Names[I] + #13#10; MsgBox('List of values:'#13#10#13#10 + S, mbInformation, MB_OK); end else begin // add any code to handle failure here end; end;