Microsoft SDK for Java

RegKey Class Constructors

The RegKey class contains the following constructors.

RegKey(RegKey rkParent, String subKey, int access)
RegKey(int rootID, String subKey, int access)
RegKey(int rootID,String subKey)

RegKey(RegKey rkParent, String subKey, int access)

Creates the specified key. If the key already exists in the Windows registry, the method opens it.

Syntax

public RegKey(RegKey rkParent, String subKey, int access) throws RegKeyException;

Parameters

rkParent The currently open key or any of the following predefined reserved identifiers:
  • null

  • HKEY_CLASSES_ROOT,

  • HKEY_CURRENT_USER,

  • HKEY_LOCAL_MACHINE

  • HKEY_USERS

The key created is a subkey of the key identified by the rkParent parameter. If the applet is running in a browser or another protected environment, this parameter must be null.

subKey The string specifying the name of a subkey that this method opens or creates. must be a subkey of the key identified by the rkParent parameter. This subkey must not begin with the backslash character (\). The rkParent parameter cannot be null.
access The read-write access privileges for the key.

Exceptions

com.ms.lang.RegKeyException if the key cannot be created.

RegKey(int rootID, String subKey, int access)

A convenience constructor that performs Regkey.getRootKey automatically.

Syntax

public RegKey(int rootID, String subKey, int access) throws RegKeyException;

Parameters

rootID The rootID of the key.
subKey A string specifying the name of a subkey that this method opens or creates. The subkey must not begin with the backslash character (\). The rkParent parameter cannot be null.
access The read-write access for the key.

RegKey(int rootID,String subKey)

Opens a key for reading.

Syntax

public RegKey(int rootID,String subKey) throws RegKeyException;

Parameters

rootID The root identifier of the key.
subKey A string specifying the name of a subkey that this method opens or creates. The subkey must not begin with the backslash character (\). This parameter cannot be null.

© 1999 Microsoft Corporation. All rights reserved. Terms of use.