Jump to content
Sign in to follow this  
Hyflex

GUI Password to launch New GUI

Recommended Posts

Hyflex

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.

Share this post


Link to post
Share on other sites
digiworks

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..

Share this post


Link to post
Share on other sites
Hyflex

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

Share this post


Link to post
Share on other sites
spudw2k

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
Sign in to follow this  

×