Pascal Scripting: RegQueryStringValue

Prototype:

function RegQueryStringValue(const RootKey: Integer; const SubKeyName, ValueName: String; var ResultStr: String): Boolean;

Description:

Queries the specified REG_SZ- or REG_EXPAND_SZ-type value, and returns the data in ResultStr. Returns True if successful. When False is returned, ResultStr is unmodified.

Example:
var
  Country: String;
begin
  if RegQueryStringValue(HKEY_CURRENT_USER, 'Control Panel\International',
     'sCountry', Country) then
  begin
    // Successfully read the value
    MsgBox('Your country: ' + Country, mbInformation, MB_OK);
  end;
end;