I have a VC++ console application that I want to make run on startup. I want to do this by adding it to the registry I have already tried what I found on another post about this but it didnt work, I logged out and then signed back in but the program didnt start. Here is the code I used
string progPath = "C:/Users/user/AppData/Roaming/Microsoft/Windows/MyApp.exe";
HKEY hkey = NULL;
long createStatus = RegCreateKey(HKEY_CURRENT_USER, L"/SOFTWARE/Microsoft/Windows/CurrentVersion/Run", &hkey);//Creates a key
long status = RegSetValueEx(hkey, L"MyApp", 0, REG_SZ, (BYTE *)progPath.c_str(), sizeof(progPath.c_str()));
Any help is appreciated