winreg.PyHKEY.Detach()

PyHKEY.Detach() Detaches the Windows handle from the handle object. The result is an integer that holds the value of the handle before it is detached. If the handle is already detached or closed, this will return zero. After calling this function, the handle is effectively invalidated, but the handle is not closed. You would call this function when you need the underlying Win32 handle to exist beyond the lifetime of the handle object.

winreg.LoadKey()

winreg.LoadKey(key, sub_key, file_name) Creates a subkey under the specified key and stores registration information from a specified file into that subkey. key is a handle returned by ConnectRegistry() or one of the constants HKEY_USERS or HKEY_LOCAL_MACHINE. sub_key is a string that identifies the subkey to load. file_name is the name of the file to load registry data from. This file must have been created with the SaveKey() function. Under the file allocation table (FAT) file system, the

winreg.PyHKEY.Close()

PyHKEY.Close() Closes the underlying Windows handle. If the handle is already closed, no error is raised.

winreg.OpenKeyEx()

winreg.OpenKeyEx(key, sub_key, reserved=0, access=KEY_READ) Opens the specified key, returning a handle object. key is an already open key, or one of the predefined HKEY_* constants. sub_key is a string that identifies the sub_key to open. reserved is a reserved integer, and must be zero. The default is zero. access is an integer that specifies an access mask that describes the desired security access for the key. Default is KEY_READ. See Access Rights for other allowed values. The result is

winreg.ExpandEnvironmentStrings()

winreg.ExpandEnvironmentStrings(str) Expands environment variable placeholders %NAME% in strings like REG_EXPAND_SZ: >>> ExpandEnvironmentStrings('%windir%') 'C:\\Windows'

winreg.EnumValue()

winreg.EnumValue(key, index) Enumerates values of an open registry key, returning a tuple. key is an already open key, or one of the predefined HKEY_* constants. index is an integer that identifies the index of the value to retrieve. The function retrieves the name of one subkey each time it is called. It is typically called repeatedly, until an OSError exception is raised, indicating no more values. The result is a tuple of 3 items: Index Meaning 0 A string that identifies the value name 1

winreg.EnableReflectionKey()

winreg.EnableReflectionKey(key) Restores registry reflection for the specified disabled key. key is an already open key, or one of the predefined HKEY_* constants. Will generally raise NotImplemented if executed on a 32-bit operating system. Restoring reflection for a key does not affect reflection of any subkeys.

winreg.DeleteValue()

winreg.DeleteValue(key, value) Removes a named value from a registry key. key is an already open key, or one of the predefined HKEY_* constants. value is a string that identifies the value to remove.

winreg.EnumKey()

winreg.EnumKey(key, index) Enumerates subkeys of an open registry key, returning a string. key is an already open key, or one of the predefined HKEY_* constants. index is an integer that identifies the index of the key to retrieve. The function retrieves the name of one subkey each time it is called. It is typically called repeatedly until an OSError exception is raised, indicating, no more values are available. Changed in version 3.3: See above.

winreg.DisableReflectionKey()

winreg.DisableReflectionKey(key) Disables registry reflection for 32-bit processes running on a 64-bit operating system. key is an already open key, or one of the predefined HKEY_* constants. Will generally raise NotImplemented if executed on a 32-bit operating system. If the key is not on the reflection list, the function succeeds but has no effect. Disabling reflection for a key does not affect reflection of any subkeys.