Date: 02-16-2022
Return to Index
created by gbSnippets
'you can tell if you have admin rights with a CMD line entry:
net user <username>
'or with this:
net localgroup administrators
'in XP you can right click on START. If you see "Explore All Users"
'then the user has admin rights
'in Win7, click START then the user PICTURE.
1. Click Start.
2. Click your user picture (not your user name). Your status will be displayed.
'Compilable Example: (Jose Includes)
#Compile Exe
#Dim All
#Include "Win32API.inc"
Global hDlg as Dword
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add Button, hDlg, 100,"Push", 50,10,100,20
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
If CB.Msg = %WM_Command AND CB.Ctl = 100 AND CB.Ctlmsg = %BN_Clicked Then
? IIf$(IsTrue(IsUserAnAdmin()), "I'm an admin", "I'm a user")
End If
End Function
'gbs_01190
'Date: 05-11-2013
http://www.garybeene.com/sw/gbsnippets.htm