'registry key
'从注册表中删除一个值或键。
'   hLocation:  HKEY_CLASSES_ROOT
'               HKEY_CURRENT_USER
'               HKEY_LOCAL_MACHINE
'               HKEY_USERS
'  sSubKeys： 要删除的子项的名称。
'  sValueName： 将值的名称删除。
'   Returns:    TRUE if successful, FALSE if failed.
Function FF_DeleteRegistryKey(ByVal hLocation as HANDLE, sSubKeys as CWSTR, sValueName as CWSTR) as Long
   
   Dim hKey as HANDLE
   Dim zRegVal as wString * 1024
   zRegVal = sValueName
   If hLocation = 0 Then hLocation = HKEY_CURRENT_USER
   If sValueName <> "" Then
      If RegOpenKeyW(hLocation, RTrim(**sSubKeys, "\"), @hKey) = ERROR_SUCCESS Then
         If RegDeleteValueW(hKey, @zRegVal) = ERROR_SUCCESS Then Function = True
         
      End If
   Else
      zRegVal = sSubKeys
      If RegDeleteKeyW(hLocation, @zRegVal) = ERROR_SUCCESS Then Function = True
   End If
End Function

