I need to write a shortcut in the automatic startup folder for all users.
The scenario is that a user with administrator privileges, through the configuration dialog of the application, must be able to set the application to start automatically for all normal users when they log in.
I get the startup folder using
SHGetSpecialFolderPath(NULL, startFolderPath, CSIDL_COMMON_STARTUP, FALSE)
but then I don't have write privileges on that folder, even when the logged user is part of the Adminisrator's group.
I suppose I need to call some API function related to User Account Control (UAC) to ask permission to the logged user to elevate the current privilege.
This should work on Windows XP too