It's been a long time since I wrote a program that reads/writes to the registry, but if you look in the MSDN you'll find functions such as: RegOpenKey(), RegCloseKey(), RegCreateKey(), RegSetValue()...
For the hKey value use: "HKEY_LOCAL_MACHINE".
For the lpSubKey value use: "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run".
You need to open the key and get the handle, then use RegSetValue() to set your value (i.e. on the right side of the RegEdit window), then close the key.