SHCopyKeyA function

Recursively copies the subkeys and values of the source subkey to the destination key. SHCopyKey does not copy the security attributes of the keys.

Syntax

LSTATUS SHCopyKeyA(
  HKEY   hkeySrc,
  LPCSTR pszSrcSubKey,
  HKEY   hkeyDest,
  DWORD  fReserved
);

Parameters

hkeySrc

Type: HKEY

A handle to the source key (for example, HKEY_CURRENT_USER).

pszSrcSubKey

Type: LPCTSTR

The subkey whose subkeys and values are to be copied.

hkeyDest

Type: HKEY

The destination key.

fReserved

Type: DWORD

Reserved. Must be 0.

Return Value

Type: LSTATUS

Returns ERROR_SUCCESS if successful, or one of the nonzero error codes defined in Winerror.h otherwise. Use FormatMessage with the FORMAT_MESSAGE_FROM_SYSTEM flag to retrieve a generic description of the error.

Remarks

Important  This function does not duplicate the security attributes of the keys and values that it copies. Rather, all security attributes in the destination key are the default attributes.
 

Requirements

   
Minimum supported client Windows 2000 Professional, Windows XP [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header shlwapi.h
Library Shlwapi.lib
DLL Shlwapi.dll (version 5.0 or later)