[ Home ] [ Features ] [ Products ] [ FAQ's ] [ Screens ] [ Support ] [ Downloads ] [ About ] [ Discussion ]


the software that grows with you

 

V32RegDeleteKey()

Removes a key from the Windows Registry database.

Syntax

V32RegDeleteKey( <cKey>, [@cError] )

Arguments

cKey Character string specifying key to be deleted from the Windows Registry Database. <cKey> must include one of the base keys defined for Windows version specific base keys. The format of <cKey> will be somewhat like:

cKey := "HKEY_CURRENT_USER\Software\Vouch32"

Here "HKEY_CURRENT_USER" is one of the base keys defined by Windows. The other base keys are as under:

HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS
HKEY_CURRENT_CONFIG
HKEY_DYN_DATA

If base key is not included in the <cKey> definition, function will not execute and return value will be FALSE.

cError Optional variable passed by reference to hold the description of operation's success or failure.

Returns

lSuccess . If <cKey> is deleted successfully TRUE otherwise FALSE will be returned. Description of lSuccess will be contained in <cError> if the variable is supplied by reference.

Description

The function is handy to remove a key from the Windows Registry Database. 

IMPORTANT:   Note that while creating a key any number of subkeys can be created with single call to V32RegCreateKey() but while deleting a key last subkey must have been deleted prior to deleting the higher order key. Thus in, 

cKey := "HKEY_CURRENT_USER\Software\Vouch32\VouchIni"

the subkeys "VouchIni" under the subkey "Vouch32" under the subkey "Software" under the base key "HKEY_CURRENT_USER" will all be created at once with V32RegCreateKey( cKey, @cError )

But while deleting the subkeys "VouchIni" and "Vouch32", you need to issue two separate commands to achieve the desired results, e.g.,

V32RegDeleteKey( "HKEY_CURRENT_USER\Software\Vouch32\VouchIni" ) 
V32RegDeleteKey( "HKEY_CURRENT_USER\Software\Vouch32" ) 

And there is no way to bypass this protocol.

Usage

local cKey, lSuccess, cError

cKey := "HKEY_CURRENT_USER\Software\Vouch32"

lSuccess := V32RegDeleteKey( cKey, @cError )

if .not. lSuccess
   ? cError
endif

Tips

 

[ Home ][ Features ] [ Products ][ About Us ][ FAQ's ][ Screen Shots ][ Downloads ][ Support ][ Discussion ]
.

Vouch is a Trademark of Pritpal Bedi
All other Trade Marks are the property of their respective owners.
Copyright 1993-2011 Pritpal Bedi. All rights reserved.
Hit Counter  
You are Visitor # since 14 May 2002