What Windows API function can I use to check to see if the current user running my application has administrative privileges?
Here are my OS details : WINDOWS XP, VISTA and WINDOWS 7
Language to be used : C
Shell APIには、これを行う関数IsUserAnAdmin()があります。トークンをいじる必要はありません。
Even if the user has administrative privileges it does not mean your program does - it needs to be elevated. This can be done by the user explicitly asking to run it as an administrator, but usually it is requested by the program itself through a manifest that is embedded into the executable. Once the manifest asks for the privileges it is not optional - the program will not run until the user has approved it and supplied the password as necessary.