I'm creating C++ application and would like to give my users an option to start my application when starting windows. First thing to mind is that I use windows registry to set that, but don't know where to write and what to write. Also, do users need to have admin privileges when running my application so that it is able to write in that part of Windows registry where needed?
You'll need to use the Software\Microsoft\Windows\CurrentVersion\Run
key (see the MSDN for additional information). The (string) value should be the path to your application.
You don't need administrative privileges to create it in HKEY_CURRENT_USER
, but your application will only start for the current user's session. If you need to start up automatically for all the users, use the HKEY_LOCAL_MACHINE
hive with elevated privileges!