RegFlushKey (Windows CE 5.0)

Send Feedback

This function writes all the attributes of the specified open registry key into the registry.

LONG RegFlushKey( HKEY hKey );

Parameters

  • hKey
    [in] Handle to a currently open key or one of the following predefined reserved handle values:
    • HKEY_CLASSES_ROOT
    • HKEY_CURRENT_USER
    • HKEY_LOCAL_MACHINE
    • HKEY_USERS

Return Values

If the function succeeds, the return value is ERROR_SUCCESS.

If the function fails, the return value is a nonzero error code. You can use the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag to get a generic description of the error.

Remarks

When RegFlushKey is called, all previous changes to the registry are committed by flushing data to persistent storage. The implementation of this function is OEM-dependent. The RegFlushKey function may also write out parts of or all of the other keys. Calling this function excessively can have a negative effect on an application's performance.

By default, Windows CE does not support a lazy flush of the registry, though the OEM may choose to implement a lazy-flush or power-down flush. It is important that applications call RegFlushKey to save important registry information. Call RegFlushKey after a group of changes have been made, but not for every individual registry change. Frequent calling of RegFlushKey can degrade performance.

An application should only call RegFlushKey if it requires absolute certainty that registry changes are on disk. In general, RegFlushKey rarely, if ever, need be used.

Requirements

OS Versions: Windows CE 2.10 and later.
Header: Winreg.h.
Link Library: Coredll.lib.

See Also

FormatMessage | RegCloseKey | RegDeleteKey

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.