| Cyberwarfare (112) | |
|
Hi C++ forums, I am currently working on a program which finds if you are Admin or not if you are Admin it will pop a Window saying You are a Admin and else it says You are Not a Admin. Can anyone here help please | |
|
|
|
| andywestken (1950) | ||
|
This MSDN entry has the code for the preferred method: CheckTokenMembership function (Windows) http://msdn.microsoft.com/en-us/library/windows/desktop/aa376389%28v=vs.85%29.aspx (There's example code for a function called IsUserAdmin, but also see the community feedback) Andy PS The Shell API (include Shlobj.h, link to Shell32.lib) does have a call IsUserAnAdmin, but this is deprecated. To quote MSDN
IsUserAnAdmin function (Windows) http://msdn.microsoft.com/en-gb/library/windows/desktop/bb776463%28v=vs.85%29.aspx | ||
|
Last edited on
|
||