PyDocs

MS Windows Specific Services

MS Windows Specific Services

winreg

Windows

These functions expose the Windows registry API to Python. Instead of using an integer as the registry handle, a handle object is used to ensure that the handles are closed correctly, even if the programmer neglects to explicitly close them.
Symbols in winreg

c

CloseKey
Closes a previously opened registry key.
ConnectRegistry
Establishes a connection to a predefined registry handle on another computer, and returns a handle object.
CreateKey
Creates or opens the specified key, returning a handle object.
CreateKeyEx
Creates or opens the specified key, returning a handle object.

d

DeleteKey
Deletes the specified key.
DeleteKeyEx
Deletes the specified key.
DeleteTree
Deletes the specified key and all its subkeys and values recursively.
DeleteValue
Removes a named value from a registry key.
DisableReflectionKey
Disables registry reflection for 32-bit processes running on a 64-bit operating system.

e

EnableReflectionKey
Restores registry reflection for the specified disabled key.
EnumKey
Enumerates subkeys of an open registry key, returning a string.
EnumValue
Enumerates values of an open registry key, returning a tuple.
ExpandEnvironmentStrings
Expands environment variable placeholders %NAME% in strings like REG_EXPAND_SZ:

f

FlushKey
Writes all the attributes of a key to the registry.

h

HKEY_CLASSES_ROOT
Registry entries subordinate to this key define types (or classes) of documents and the properties associated with those types.
HKEY_CURRENT_CONFIG
Contains information about the current hardware profile of the local computer system.
HKEY_CURRENT_USER
Registry entries subordinate to this key define the preferences of the current user.
HKEY_DYN_DATA
This key is not used in versions of Windows after 98.
HKEY_LOCAL_MACHINE
Registry entries subordinate to this key define the physical state of the computer, including data about the bus type, system memory, and installed hardware and software.
HKEY_PERFORMANCE_DATA
Registry entries subordinate to this key allow you to access performance data.
HKEY_USERS
Registry entries subordinate to this key define the default user configuration for new users on the local computer and the user configuration for the current user.

k

KEY_ALL_ACCESS
Combines the STANDARD_RIGHTS_REQUIRED, KEY_QUERY_VALUE, KEY_SET_VALUE, KEY_CREATE_SUB_KEY, KEY_ENUMERATE_SUB_KEYS, KEY_NOTIFY, and KEY_CREATE_LINK access rights.
KEY_CREATE_LINK
Reserved for system use.
KEY_CREATE_SUB_KEY
Required to create a subkey of a registry key.
KEY_ENUMERATE_SUB_KEYS
Required to enumerate the subkeys of a registry key.
KEY_EXECUTE
Equivalent to KEY_READ.
KEY_NOTIFY
Required to request change notifications for a registry key or for subkeys of a registry key.
KEY_QUERY_VALUE
Required to query the values of a registry key.
KEY_READ
Combines the STANDARD_RIGHTS_READ, KEY_QUERY_VALUE, KEY_ENUMERATE_SUB_KEYS, and KEY_NOTIFY values.
KEY_SET_VALUE
Required to create, delete, or set a registry value.
KEY_WOW64_32KEY
Indicates that an application on 64-bit Windows should operate on the 32-bit registry view.
KEY_WOW64_64KEY
Indicates that an application on 64-bit Windows should operate on the 64-bit registry view.
KEY_WRITE
Combines the STANDARD_RIGHTS_WRITE, KEY_SET_VALUE, and KEY_CREATE_SUB_KEY access rights.

l

LoadKey
Creates a subkey under the specified key and stores registration information from a specified file into that subkey.

o

OpenKey
Opens the specified key, returning a handle object.
OpenKeyEx
Opens the specified key, returning a handle object.

p

PyHKEY.__enter__
The HKEY object implements __enter__() and __exit__() and thus supports the context protocol for the with statement:
PyHKEY.__exit__
The HKEY object implements __enter__() and __exit__() and thus supports the context protocol for the with statement:
PyHKEY.Close
Closes the underlying Windows handle.
PyHKEY.Detach
Detaches the Windows handle from the handle object.

q

QueryInfoKey
Returns information about a key, as a tuple.
QueryReflectionKey
Determines the reflection state for the specified key.
QueryValue
Retrieves the unnamed value for a key, as a string.
QueryValueEx
Retrieves the type and data for a specified value name associated with an open registry key.

r

REG_BINARY
Binary data in any form.
REG_DWORD
32-bit number.
REG_DWORD_BIG_ENDIAN
A 32-bit number in big-endian format.
REG_DWORD_LITTLE_ENDIAN
A 32-bit number in little-endian format.
REG_EXPAND_SZ
Null-terminated string containing references to environment variables (%PATH%).
REG_FULL_RESOURCE_DESCRIPTOR
A hardware setting.
REG_LINK
A Unicode symbolic link.
REG_MULTI_SZ
A sequence of null-terminated strings, terminated by two null characters.
REG_NONE
No defined value type.
REG_QWORD
A 64-bit number.
REG_QWORD_LITTLE_ENDIAN
A 64-bit number in little-endian format.
REG_RESOURCE_LIST
A device-driver resource list.
REG_RESOURCE_REQUIREMENTS_LIST
A hardware resource list.
REG_SZ
A null-terminated string.

s

SaveKey
Saves the specified key, and all its subkeys to the specified file.
SetValue
Associates a value with a specified key.
SetValueEx
Stores data in the value field of an open registry key.