Registry Fundamentals (Windows Embedded CE 6.0)

1/6/2010

The registry is a system database that stores configuration information for applications, drivers, and the OS. The registry is most commonly use for storing state information across invocations. For example, an application might have windows that a user can move and resize. Before exiting, the application could store its windows information in the registry. Then, when the application starts again, it could retrieve the information and position its windows accordingly.

The structure of the Windows Embedded CE registry is similar to the registries in other versions of Windows. The registry contains a forest of data subtrees. Each subtree is composed of branches called keys, and each key can contain subkeys and/or entries. Entries are stored as name/value pairs. At the base of each subtree is the root, which is identified using a well-known constant value, or HKEY.

The following table shows the root constants supported by Windows Embedded CE and gives a brief description of each.

Root key constant Description

HKEY_CLASSES_ROOT

Stores file type matching and OLE configuration data.

HKEY_CURRENT_USER

Stores user-specific data for the user who is currently logged in. This root points to the relevant key of HKEY_USERS. Changes made are automatically made in the user's key under HKEY_USERS.

HKEY_LOCAL_MACHINE

Stores machine-specific data for device drivers and applications.

HKEY_USERS

Stores data for all users including a default user.

The basic piece of data that is stored in the registry is called a value. A value can be a variety of types, including string or binary. Each value has a name and an associated piece of data.

Registry Operations

Most registry operations require use of registry functions. The Windows Embedded CE registry exports the Win32 registry functions for applications to call to record and access run-time and other data. Use the registry to store data that your application needs for each session. For example, you can save the state of your application during the shutdown process. Upon startup, your application can reinstate the previous settings.

For more information, see Programmatic Registry Operations.

See Also

Concepts

Registry Keys
Registry Types
Considerations for Registry Use

Other Resources

Registry Overview