RegFlushKey

  LONG RegFlushKey(hkey)    
  HKEY hkey; /* identifies key to write */

The RegFlushKey function writes all the attributes of an open key to the configuration registry.

Parameters

hkey

Identifies a currently open key or any of the following predefined reserved handle values:

HKEY_CLASSES_ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE HKEY_USERS

Return Value

The return value is ERROR_SUCCESS if the function is successful. Otherwise, it is an error value.

Comments

Closing a key without calling this function will not abort changes made to the key. Closing a key also writes the key's data to the configuration registration database.

The RegFlushKey function does not return until all the data has been written to the registry.

The RegFlushKey function may also write out parts of or all of other keys. Calling this function excessively can seriously impact an application's performance.

See Also

RegCloseKey