RegistryWrite

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.

SalBoolean RegistryWrite( SalNumber hKey,
		       SalString sSubKey,
		       SalString sValueName,
		       SalString sValue )

The RegistryWrite method writes a value to 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 write value to. Use the "backslash" character ( to denote multiple levels in the subkey.
SalString sValueName Name of value to write. If this parameter is strNULL, the default value for the key will be written.
SalString sValue The value to write.

Returns

The return value is TRUE if the value was successfully written, FALSE otherwise

Comments

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

Example

Call Profile.RegistryWrite( HKEY_CLASSES_ROOT,
		          '.ifm', strNULL, 'ifm_auto_file' )
Call Profile.RegistryWrite( HKEY_CLASSES_ROOT,
        'ifm_auto_file', strNULL, 'IFS Applications Message' )
C# code
// Login state. Write to the registry to be sure that these pre-logon settings are not stored in the databse
Var.Profile.RegistryWrite(Const.HKEY_CURRENT_USER, 
Const.REGISTRY_KEY_PersonalProfile + Vis.StrSubstitute(sProfileSection, ".", "\\"),
"LoginOnStartup", Int.PalBooleanToStr(cbConnect.Checked)); Var.Profile.RegistryWrite(Const.HKEY_CURRENT_USER,
Const.REGISTRY_KEY_PersonalProfile + Vis.StrSubstitute(sProfileSection + ".LoginDialogSettings", ".", "\\"),
"AlwaysShowLoginDialog", Int.PalBooleanToStr(cbShowLoginDialog.Checked));