Name
ReadRegistryKey -- read a key from the registry (V4.5)
Synopsis
value = ReadRegistryKey(base, key$)
Platforms
Microsoft Windows only

Function
This function can be used to read a key from the Windows registry. You have to specify the base tree as well as the key to read. The base tree can be one of the following constants:

 
#HKEY_CLASSES_ROOT
#HKEY_CURRENT_CONFIG
#HKEY_LOCAL_MACHINE
#HKEY_USERS
#HKEY_CURRENT_USER

The return value will be a number in case the registry key contains a number. If the registry key contains a string or binary data, you will get a string as a return value. Hollywood strings are capable of holding binary data because they allow NULL characters in them.

Inputs
base
one of the base tree constants from above
key$
the registry key to query
Results
value
value of specified registry key; will be either a number or a string
Example
program_files$ = ReadRegistryKey(#HKEY_LOCAL_MACHINE,
      "Software/Microsoft/Windows/CurrentVersion/ProgramFilesDir")
The code above reads the default location of programs under Windows from the registry. On a German Windows system, this will usually return "C:/Programme".

Show TOC