Registry Access

See Also

Category System Utilities
Default Catalog Visual FoxPro Catalog\Foundation Classes\Utilities
Class registry
Base Class Custom
Class Library registry.vcx
Parent Class registry
Sample ...\Samples\Vfp98\Solution\WinAPI\regfox.scx

Remarks

This class provides access to information in the Windows Registry.

To use, drop the class on a project or form or, from the Component Gallery Item Shortcut menu, select Add to Project or Add to Form. When you add the class to a form, Visual FoxPro places the class on the form. You can then specify the appropriate property values and provide any necessary input and output objects. When you drop the class on a project, you can choose between adding the class or creating a subclass.

See Guidelines for Using Visual FoxPro Foundation Classes for more information on using foundation classes.

Properties, Events, Methods Description
CloseKey method Closes a registry key.
Syntax: CloseKey( )
Return: 0 if successful; otherwise the Windows API error code.
Arguments: none
DeleteKey method Deletes a registry key.
Syntax: DeleteKey(nUserKey, cKeyPath)
Return: 0 if successful; otherwise the Windows API error code.
Arguments:
nUserKey specifies the Registry User key.
cKeyPath specifies the Registry User key path.
DeleteKeyValue method Deletes a value from a registry key.
Syntax: DeleteKeyValue(cOptName, cKeyPath, nUserKey)
Return: 0 if successful; otherwise the Windows API error code.
Arguments:
cOptName specifies the name of the Registry key option.
cKeyPath specifies the path to the Registry key.
nUserKey specifies the User key.
EnumKeys method Enumerates through a registry key.
Syntax: EnumKeys(@aKeyNames)
Return: 0 if successful; otherwise the Windows API error code.
Arguments:
aKeyNames specifies the Registry keys to enumerate.
EnumKeyValues method Enumerates through values of a registry key.
Syntax: EnumKeyValues(@aKeyValues)
Return: 0 if successful; otherwise the Windows API error code.
Arguments:
aKeyValues specifies the Registry User key values to enumerate.
EnumOptions method Enumerates through all entries for a key and populates an array with values.
Syntax: EnumOptions(@aRegOpts, cOptPath, nUserKey, lEnumKeys)
Return: 0 if successful; otherwise the Windows API error code.
Arguments:
aRegOpts specifies the Registry key option.
cOptPath specifies the path to the Registry key option.
nUserKey specifies the User key ID.
lEnumKeys specifies whether to enumerate other options, if they exist.
GetKeyValue method Returns the value for a key.
Syntax: GetKeyValue(cValueName, cKeyValue)
Return: 0 if successful; otherwise the Windows API error code.
Arguments:
cValueName specifies the name of the value to retrieve.
cKeyValue specifies the value of cValueName.
GetRegKey method Returns a registry key setting.
Syntax: GetRegKey(cOptName, cOptVal, cKeyPath, nUserKey)
Return: 0 if successful; otherwise the Windows API error code.
Arguments:
cOptName specifies the name of the Registry key option.
cOptVal specifies the value to apply to the option.
cKeyPath specifies the Registry key path.
nUserKey specifies the User key.
IsKey method Returns whether a specified key exists.
Syntax: IsKey(cKeyName, nRegKey)
Return: 0 if successful; otherwise the Windows API error code.
Arguments:
cKeyName specifies the name of the user ley to check, if it exists.
nRegKey specifies the Registry key ID
OpenKey method Opens a registry key.
Syntax: Open(cLookUpKey, nRegKey, lCreateKey)
Return: 0 if successful; otherwise the Windows API error code.
Arguments:
cLookUpKey specifies the name of the user key for which to search.
nRegKey specifies the Registry key ID
lCreateKey specifies whether to create a new Registry key if the specified one does not exist.
SetKeyValue method Sets the value of a registry key.
Syntax: SetKeyValue(cValueName, cValue)
Return: 0 if successful; otherwise the Windows API error code.
Arguments:
cValueName specifies the name of the value to set.
cValue specifies the value to apply to cValueName.
SetRegKey method Sets the registry key setting.
Syntax: SetRegKey(cOptName, cOptVal, cKeyPath, nUserKey, lCreateKey)
Return: 0 if successful; otherwise the Windows API error code.
Arguments:
cOptName specifies the name of the Registry key option.
cOptVal specifies the value to apply to the option.
cKeyPath specifies the Registry key path.
nUserKey specifies the User key ID.
lCreateKey specifies to create the new key. The new key is created if lCreateKey is set to true (.T.).
cAppPathKey property Internal to the class.
cIniDllFile property Internal to the class.
cODBCDllFile property Internal to the class.
cRegDllFile property Internal to the class.
cVfpOptPath property Internal to the class.
lCreateKey property Internal to the class.
lHadError property Internal to the class.
lLoaddedDlls property Internal to the class.
lLoadedInis property Internal to the class.
lLoadedOdbcs property Internal to the class.
nCurrentKey property Internal to the class.
nCurrentOS property Internal to the class.
nUserKey property Internal to the class.
LoadRegFuncs method Internal to the class.