Navigation: Language Reference > 13 - Built-in Functions >====== DELETEREG (remove a value or key from Windows registry) ====== | |
DELETEREG (LONG root, STRING keyname [.STRING valuename])
DELETEREG | Deletes a named entry from the system registry. |
root | The root section of the registry from which to delete the value. Valid values for this are defined in equates.clw and are as follows: |
REG_CLASSES_ROOT | |
REG_CURRENT_USER | |
REG_LOCAL_MACHINE | |
REG_USERS | |
REG_PERFORMANCE_DATA | |
REG_CURRENT_CONFIG | |
REG_DYN_DATA | |
keyname | The name of the key to delete, or the key to delete from. |
valuename | The name of the value to delete. If omitted the whole key is deleted. |
Vista and Clarion Built-in Registry Functions
On Vista, a (non-elevated) app can READ the registry key HKLM (local machine) with no problems, but as far as writing to the Registry it needs to use HKCU (current user).
If you code sign your executable and run with elevated privileges then you can write to HKLM
Example:
PROGRAM
MAP
END
INCLUDE('EQUATES')
CurrentPath CSTRING(100)
ColorScheme CSTRING(100)
CODE
DELETEREG(REG_LOCAL_MACHINE,'SOFTWARE\SoftVelocity\Clarion7','root')
!remove the root directory entry of the Clarion 6 install
DELETEREG(REG_CURRENT_USER,'Control Panel\Current')
!since a specific value is not specified,
!the entire “Current” key will be removed
See Also: