VB6 is an application running as an administrator

Is there a way to find out if the application works as an administrator?

If this is due to a COM call, I didn’t really fuss, all that works!

+4
source share
2 answers

IsUserAnAdmin is a simple call and seems completely reliable for use in VB6 programs. It seems to work just fine even in Win8.

Please note that it reports whether the process works with administrator rights, and whether the user is in the Administrators group.

Having declared it this way, it should fully work in Windows 2000:

Private Declare Function IsUserAnAdmin Lib "shell32" Alias "#680" () As Long 
+6
source

You can use the CheckTokenMembership() function with the administrator SID. However, I have not tried calling it from VB. (Adapted from the Inno IsAdminLoggedOn() function.

+1
source

Source: https://habr.com/ru/post/1385125/


All Articles