Results 1 to 2 of 2

Thread: Admin check with a service...

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2004
    Posts
    27

    Admin check with a service...

    VB Code:
    1. Private Sub NTadmin_Timer()
    2.     If Form1.Visible = False Then
    3.         If CBool(IsNTAdmin(ByVal 0&, ByVal 0&)) = True Then
    4.             Form1.Visible = True
    5.             App.TaskVisible = True
    6.         End If
    7.     End If
    8.     If Form1.Visible = True Then
    9.         If CBool(IsNTAdmin(ByVal 0&, ByVal 0&)) = False Then
    10.             Form1.Visible = False
    11.             App.TaskVisible = False
    12.         End If
    13.     End If
    14. End Sub

    i use that every second to check if an admin is logged in with this service....

    if i log in with my admin account on XP, it will show the program (programs defaults are hidden)

    but if i log in as a guest after logged in as admin the program will not hide!

    big problem, cant have guest accounts messin with the program....

  2. #2
    try using elseif instead of endif and then if

    VB Code:
    1. Private Sub NTadmin_Timer()
    2.     If CBool(IsNTAdmin(ByVal 0&, ByVal 0&) = True Then
    3.             Form1.Visible = True
    4.             App.TaskVisible = True
    5.     ElseIf CBool(IsNTAdmin(ByVal 0&, ByVal 0&) = False Then
    6.             Form1.Visible = False
    7.             App.TaskVisible = False
    8.     End If
    9. End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width