RegistryRead

Note: This page includes content based on the F1 documentation for Centura development. It may be partially converted to support APF development, but should be regarded to be of uncertain actuality. It is provided as is. Eventually, it should be replaced by documentation available from within Visual Studio.

SalNumber RegistryRead( SalNumber hKey,
		     SalString sSubKey,
		     SalString sValueName,
		     ref SalString sValue )

The RegistryRead method reads a value from the Windows registry.

Parameters

Name Description
SalNumber hKey Identifies a currently open key or any of the following predefined reserved handle values: Const.HKEY_CLASSES_ROOT, Const.HKEY_CURRENT_USER, Const.HKEY_LOCAL_MACHINE, Const.HKEY_USERS
SalString sSubKey Name of subkey to read value for. Use the "backslash" character ( to denote multiple levels in the subkey.
SalString sValueName Name of value to read. If this parameter is strNULL, the default value for the key will be read.
ref SalString ssValue The value is returned in this variable. If the subkey or the value is not found, this parameter is set to strNULL.

Returns

The return value is the number of bytes read.

Comments

You can only use this method to read registry values of the REG_SZ (null-terminated string) type.

Example

Call Profile.RegistryRead( HKEY_CLASSES_ROOT,
		        '.ifm', strNULL, sRegIfm )
Call Profile.RegistryRead( HKEY_CLASSES_ROOT,
                'ifm_auto_file\shell\open\command', strNULL, sRegProgram )
C# code
// Login state. Read from the registry to be sure that these pre-logon settings are not read from the databse
if (Var.Profile.RegistryRead(Const.HKEY_CURRENT_USER, 
Const.REGISTRY_KEY_PersonalProfile + Vis.StrSubstitute(sProfileSection, ".",
"\\"), "LoginOnStartup", ref sValue) <= 0) {
..............