# Ini_ReadFromRegistry

int Ini_ReadFromRegistry (IniText handle, int rootKey, const char subkeyName[]);

## Purpose

Reads tag/value pairs from the Windows Registry into the list identified by handle.

If you want to read the data from a source other than a file or the Windows Registry, use the Ini_ReadGeneric function.

## Parameters

Input
Name | Type | Description
handle | IniText | A handle returned from Ini_New. It represents the list of in-memory tag/value pairs.
rootKey | integer | The Root Key in the Registry from which to read. The available Root Keys are: HKEY_CLASSES_ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE HKEY_USERS
| Note Applications typically store global configuration data under: HKEY_LOCAL_MACHINE\\Software\\CompanyName\\AppName\\Version\\ And per-user configuration data under: HKEY_CURRENT_USER\\Software\\CompanyName\\AppName\\Version\\
subkeyName | const char [] | A NULL-terminated string containing the name of the Registry Subkey from which to read tag/value pairs. The Subkey should be '\' separated and relative to the specified Root Key. The following is an example of a valid Subkey string for the Root Key HKEY_CURRENT_USER: "Software\\National Instruments\\CVI\\5.0"

## Return Value

Name | Type | Description
status | integer | Indicates whether the function was successful. A zero indicates success. A negative value indicates an error. If the value is from –1 to –999, it is one of the error values defined in userint.h. If the value is from –5000 to –5999, it is one of the error values defined in toolbox.h. Among the more commonly encountered errors are:
–12 | Out of memory!
–91 | Too many files are open.
–92 | Unexpectedly reached end of file.
–93 | Input/Output error.
–94 | File not found.
–95 | File access permission denied.
–99 | File already open.
–100 | Badly formed pathname.
–5001 | Could not open file for reading
–5002 | Error reading file