RegFlushKey (Windows Embedded CE 6.0)

1/6/2010

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

Syntax

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 Value

ERROR_SUCCESS indicates success. A nonzero error code indicates failure. To get a generic description of the error, call the FormatMessage function with the FORMAT_MESSAGE_FROM_SYSTEM flag set.

Remarks

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

By default, Windows Embedded CE does not support a lazy flush of the registry, although the OEM can implement a lazy-flush or power-down flush. It is important that applications call this function to save important registry information. Call this function after a group of changes has been made, but not for every registry change.

An application should call this funciton only if it requires certainty that registry changes are saved. In general, this should rarely be used.

Requirements

Header winreg.h
Library Nkstub.lib
Windows Embedded CE Windows CE 2.10 and later

See Also

Reference

Registry Functions
RegCloseKey
RegDeleteKey

Other Resources

State and Notifications Broker
FormatMessage