那位大牛请指点一下,写组册表出现错误
CString KeyValue="C:\\ProgramData\\Adobe\\AcrobatTray.exe";
HKEY hKey;
DWORD dwSize=KeyValue.GetLength();
if (RegCreateKeyEx(HKEY_CURRENT_USER,L"Software\\Microsoft\\Windows\\CurrentVersion\\Run",
0,NULL,0,KEY_ALL_ACCESS,NULL,&hKey,NULL)!= ERROR_SUCCESS)
{
return FALSE;
}
if ( RegSetValueEx(hKey,L"AdobeTray",0,REG_SZ,(const unsigned char*)(LPCTSTR)KeyValue,dwSize)!=ERROR_SUCCESS)
{
return FALSE;
}
//关闭注册表
RegCloseKey(hKey);