Closing a Registry Key

After you are done with a registry key, close the key by calling the RegCloseKey function. Calling RegCloseKey instructs Windows CE to flush any unwritten data to the key before closing the key.