wwAPI::WriteRegistryString

Writes a string value to the registry.

If the value doesn't exist it's created. If the key doesn't exist it is also created, but this will only succeed if it's the last key on the hive.

o.WriteRegistryString(tnHKey, tcSubkey, tcEntry, tcValue,tlCreate)

Return Value

.T. or .F.

Parameters

tnHKey
HKEY value from WCONNECT.H

#DEFINE HKEY_CLASSES_ROOT           -2147483648  && (( HKEY ) 0x80000000 )
#DEFINE HKEY_CURRENT_USER           -2147483647  && (( HKEY ) 0x80000001 )
#DEFINE HKEY_LOCAL_MACHINE          -2147483646  && (( HKEY ) 0x80000002 )
#DEFINE HKEY_USERS                  -2147483645  && (( HKEY ) 0x80000003 )

tcSubkey
The subkey to write to

tcEntry
The keyname to write

tcValue
The string value to write.

tlCreate
If .T. creates the key including the lead up subtree.

Example

#INCLUDE WCONNECT.H
loAPI = CREATE("wwAPI")

lcVersion = "4.20"

*** Update the Version number as a strnig
loAPI.WriteRegistryString(HKEY_LOCAL_MACHINE,;
   "SOFTWARE\West Wind Technologies\Web Connection",;
   "CurrentVersion",lcVersion,.T.)

See also:

Class wwAPI

© West Wind Technologies, 2023 • Updated: 09/13/09
Comment or report problem with topic