Jump to content

GUI Password to launch New GUI


Hyflex
 Share

Recommended Posts

I've been playing around with autoit for a few hours this afternoon trying to get a script working but everything I try doesn't work.

Password GUI Box:

$Verification = GUICreate("R Verification", 250, 100, -1, -1)
$VPassword = GUICtrlCreateInput("", 8, 30, 235, 25, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
$OkLaunch = GUICtrlCreateButton("&OK", 86, 64, 75, 25, $BS_NOTIFY)
$Cancel = GUICtrlCreateButton("&Cancel", 167, 64, 75, 25, $BS_NOTIFY)
$RTRPasswordLabel = GUICtrlCreateLabel("Please enter the password.", 8, 10, 200, 15, 0)
GUISetState(@SW_SHOW)

I've tried things like:

If GUICtrlRead($VPassword) = "password" Then
GUIDelete($Verification)
RunFiller()
Else
MsgBox("1", "Password incorrect", "Password incorrect")
EndIf

It works but I can't run functions with the new GUI

The New GUI Consists of 22 Username buttons and 23 (yes 23) password buttons.

They all do the same thing, I just change "$VarInput" to whatever the username or password is.

WinSetState($NewGUI, "", @SW_MINIMIZE)
$VarInput = ""
While WinGetState($NewGUI) = 8
Sleep(100)
WEnd
Sleep(500)
ClipPut($VarInput)
$ReadVar = ClipGet()
Send("^v")
ClipPut("")
$ReadVar = ClipGet()

How do I get it to launch the new GUI correctly and give it some functionality.

Link to comment
Share on other sites

Maybe this is what you're looking for??

$bLoop = 1
While $bLoop = 1
 $text = InputBox("Input Password", "Please enter the password and click OK", "", "*")
 If @error = 1 Then
  MsgBox(4096, "Error", "Incorrect Password")
 Else
  If $text <> "password" Then
   MsgBox(4096, "Error", "Incorrect Password")
  Else
   $bLoop = 0
  EndIf
 EndIf
WEnd


script here..
Link to comment
Share on other sites

Thank you very much, I made a few changes:

; Set Loop to Active
$VerificationLoop = 1

; Verification Loop
While $VerificationLoop = 1
    $VerificationInput = InputBox("Please enter the password and click OK", "", "*")
    If @error = 1 Then
        Exit
    Else
        If $VerificationInput  = "password" Then
            $VerificationLoop = 0
        Else
            If $VerificationInput = "" Then
                MsgBox(4096, "Error", "You must insert a password")
            Else
                MsgBox(4096, "Error", "Incorrect Password")
            EndIf
        EndIf
    EndIf
WEnd

Thanks once again :oops:

Edited by XxXGoD
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...