RegSaveKey

  LONG RegSaveKey(hkey, lpszFile, lpsa)    
  HKEY hkey; /* key where save begins */
  LPTSTR lpszFile; /* name of file to save to */
  LPSECURITY_ATTRIBUTES lpsa; /* optional security for new file */

The RegSaveKey function saves a key (and all of its descendants) to a new file.

Parameters

hkey

Specifies a handle to the key where the save operation is to begin, or any of the following predefined reserved handle values:

HKEY_CLASSES_ROOT HKEY_CURRENT_USER HKEY_LOCAL_MACHINE HKEY_USERS

lpszFile

Points to a null-terminated string that specifies a file where the tree rooted at the supplied key handle will be saved. This file must not already exist.

lpsa

Points to a SECURITY_ATTRIBUTES structure for the newly created file. If this parameter is NULL, the file has no security attributes.

Return Value

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

See Also

RegRestoreKey