ContentsIndexPreviousNext

REG_DELETE_KEY Routine

Deletes a specified registry key by providing access to the Windows registry routine RegDeleteKey. When a key is deleted, its value and all of its subkeys are also deleted.


Note: On Windows NT systems only, this routine cannot be used to delete keys that have subkeys.
Usage

 Call "REG_DELETE_KEY"
   USING OPEN-KEY-HANDLE,
   SUBKEY-TO-BE-DELETED,
   GIVING STATUS-CODE

Parameters

OPEN-KEY-HANDLE Usage unsigned-long

Handle of a currently open key or one of the following predefined handles of keys that are always open (defined in acugui.def):

HKEY_CLASSES_ROOT

HKEY_CURRENT_USER

HKEY_LOCAL_MACHINE

HKEY_USERS

The key deleted by REG_DELETE_KEY is a subkey of the key identified by OPEN-KEY-HANDLE.

SUBKEY-TO-BE-DELETED PIC X(n)

Name of the key to delete. Must be a subkey of the key identified by OPEN-KEY-HANDLE. If SUBKEY-TO-BE-DELETED is set to NULL or to a string consisting of all spaces, the routine does nothing and returns with STATUS-CODE set to '13'.

STATUS-CODE Numeric data item.

Receives the return status of the call to Microsoft's "RegDeleteKey" function. A return status of zero indicates success; non-zero indicates that an error occurred. On 32-bit Windows systems, a return status of '5' indicates that either the application does not have delete privileges for the specified key, or another application has the key opened.