This function reads an expand string value in the opened registry key.
ReadExpandStringValue (ValueName As String, Value As String, Expand As Boolean) As Long
Parameters
ValueName
[in] Name of the value to read.
Value
[out] Return the read string value.
Expand
[in] If TRUE, the environment variables in the string are expanded to their current values.
Return Value
0: success
1: value name not accessible
2: value is not of type string
4: expand failed
Remark
An expand string is like a regular string, except that it can hold environment variables. Those variables can be expanded with their contents when reading them.
For example, if an expand string value in the registry hold the following value: "%SystemRoot%", and we read that value with the Expand parameter to TRUE, we will receive a string like: "c:\windows".