hi i have the following code but the problem is
that when i run it it returns error_success
when in fact it doesn't actually edit the registry. i have admin access
so this is not a problem
HKEY hkey;
char * strPath = "notepad.exe";
if (RegOpenKeyEx(HKEY_CURRENT_USER,"Software\\Microsoft\\Windows\\CurrentVersion\\Run",0,KEY_WRITE,&hkey) == ERROR_SUCCESS)
{
if(RegSetValueEx(hkey,"YourProgName",0,REG_SZ,(LPBYTE) strPath,sizeof(strPath)) == ERROR_SUCCESS){
RegCloseKey(hkey);
cout << "error success" << ERROR_SUCCESS << endl;
system("pause");
}
}
return 0;