Hi
You may try the code below to see if that works for you.
#include <iostream>
#include <tchar.h>
#include <shlwapi.h>
#include <Windows.h>
int _tmain(int argc, _TCHAR* argv[])
{
SECURITY_ATTRIBUTES sa;
sa.nLength = sizeof (SECURITY_ATTRIBUTES);
sa.lpSecurityDescriptor = NULL;
sa.bInheritHandle = FALSE;
HKEY hKeyDst;
DWORD dwDisposition;
int rt = RegCreateKeyEx(HKEY_CURRENT_USER,"Clarify",0,"",0,KEY_READ |
KEY_WRITE,&sa,&hKeyDst,&dwDisposition);
if(!rt)
{
rt = SHCopyKeyW(HKEY_LOCAL_MACHINE,L"SOFTWARE\\Clarify",hKeyDst,0);
RegCloseKey(hKeyDst);
}
printf("%d",rt);
return 0;
}
Best regards,
Peter Huang
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
"Peter Huang" - 21 Oct 2004 02:42 GMT
Hi
Have you tried my suggstion?
IF you still have any concern on this issue please feel free to post here.
Best regards,
Peter Huang
Microsoft Online Partner Support

Signature
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
Pamela - 19 May 2005 14:51 GMT
Hello Peter,
I was trying to use the code you gave below in my Visual Studio 6.0 C++
project to copy over a current folder registry settings (and all sub
folders) from a Current_User to a new folder in Current_user. I included
the <shlwapi.h> in the file but get the following error message:
error C2065: 'SHCopyKeyW' : undeclared identifier
The version of the shlwapi.dll is 6.0.2800.1612.
Any suggestions?