setRootKey
Changes the root key being accessed.
Method of
Syntax
Parameters
The method has the following parameter:
keyAn integer representing a root key in the registry. Returns
Description
The
setRootKeychanges the root key. When you create aWinRegobject, it is set to access keys under theHKEY_CLASSES_ROOTportion 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_ROOTis the only valid value and this method does nothing.These root keys are represented as fields of the
WinRegobject. The values you can use are:
- ·
HKEY_CLASSES_ROOT- ·
HKEY_CURRENT_USER- ·
HKEY_LOCAL_MACHINE- ·
HKEY_USERSExample
To use the
HKEY_USERSsection, use these statements:
winreg = getWinRegistry();
winreg.setRootKey(winreg.HKEY_USERS);
| Netscape Communications devedge.netscape.com |