Am trying to Remove application from startup list but no success , error code is zero , so need help my function code is
string appName="someapp";
REGSAM flag = KEY_WOW64_64KEY;
HKEY hkey = HKEY_LOCAL_MACHINE;
RegOpenKeyEx(HKEY_LOCAL_MACHINE,TEXT("SOFTWARE\\Wow6432Node\\Microsoft\\Windows\\CurrentVersion\\Run"),NULL, KEY_READ | KEY_WRITE | flag,&hkey);
RegDeleteValue(hkey,appName.c_str());
cout<<"\n error code is "<<GetLastError();
RegCloseKey(hkey);