win32api.RegFlushKey

RegFlushKey(key)

Writes all the attributes of the specified key to the registry.

Parameters

key : PyHKEY/int

An already open key, or any one of the following win32con constants:
HKEY_CLASSES_ROOT
HKEY_CURRENT_USER
HKEY_LOCAL_MACHINE
HKEY_USERS

Comments

It is not necessary to call RegFlushKey to change a key. Registry changes are flushed to disk by the registry using its lazy flusher. Registry changes are also flushed to disk at system shutdown.
Unlike win32api::RegCloseKey, the RegFlushKey method returns only when all the data has been written to the registry.
An application should only call RegFlushKey if it requires absolute certainty that registry changes are on disk. If you don't know whether a RegFlushKey call is required, it probably isn't.

Win32 API References

Search for RegFlushKey at msdn, google or google groups.