SHCopyKey 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 SHCopyKey(      
    HKEY hkeySrc,     LPCTSTR szSrcSubKey,     HKEY hkeyDest,     DWORD fReserved );

Parameters

hkeySrc
[in] A handle to the source key (for example, HKEY_CURRENT_USER ).
szSrcSubKey
[in] The subkey whose subkeys and values are to be copied.
hkeyDest
[in] The destination key.
fReserved
Reserved. Must be 0.

Return Value

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.

Function Information

Minimum DLL Versionshlwapi.dll version 5.0 or later
Custom ImplementationNo
Headershlwapi.h
Import libraryshlwapi.lib
Minimum operating systems Windows 2000, Windows NT 4.0 with Internet Explorer 5, Windows 98, Windows 95 with Internet Explorer 5
UnicodeImplemented as ANSI and Unicode versions.
Tags :


Page view tracker