Changes the root key being accessed.
void setRootKey ( int key );
The method has the following parameter:
- An integer representing a root key in the registry.
setRootKey changes the root key.
When you create a
WinReg object, it is set to access keys under the
HKEY_CLASSES_ROOT portion of the registry. If you want to access keys in another portion, you must use this method to change the root key.
On 16-bit Windows platforms,
HKEY_CLASSES_ROOT is the only valid value and this method does nothing.
These root keys are represented as fields of the
WinReg object. The values you can use are:
To use the
HKEY_USERS section, use these statements:
winreg = getWinRegistry(); winreg.setRootKey(winreg.HKEY_USERS);