Reading a Registry Key or Value
Use the RegQueryValueEx function to read a specified value from the registry. RegQueryValueEx returns the type and contents of a value. Similarly, you can use RegQueryInfoKey to receive data about a specified key. RegQueryInfoKey returns information such as the class name, number of subkeys, and number of values associated with the key, as well as the lengths of the longest subkey name, value name, and value under the key.