Jump to content

Input box


Recommended Posts

Hi I have an input box that collects a password and it works fine. But I would now like to add a message box if the Cancel button is clicked.

I have been tearing my hair out trying to get this to work, can anyone help ?

Thanks

Original Code

$passwd = InputBox("Security Check", "This is a secure device and should only be used by the owner." & @CRLF & " " & @CRLF & " " & @CRLF & "Enter your password.", "", "*")
                    
Run("truecrypt.exe /l " & $Found & "/m /a /q, 1, true /v encrypted.tc /p " & $passwd)

What I'm Trying

$passwd = InputBox("Security Check", "This is a secure device and should only be used by the owner." & @CRLF & " " & @CRLF & " " & @CRLF & "Enter your password.", "", "*")

If @error = 1 Then
    MsgBox(0,"Error","Cancel")
Else

; Continue script
Edited by brian873
Link to comment
Share on other sites

Ok, what you need to do is make a GUI instead of a inputbox. That way you can have whatever button you like, and control what they do. To have it so when the password is entered you see *****, do this: GUICtrlCreateInput for the input field, and use $ES_PASSWORD for the style.

Link to comment
Share on other sites

Hi I have an input box that collects a password and it works fine. But I would now like to add a message box if the Cancel button is clicked.

I have been tearing my hair out trying to get this to work, can anyone help ?

Thanks

Original Code

$passwd = InputBox("Security Check", "This is a secure device and should only be used by the owner." & @CRLF & " " & @CRLF & " " & @CRLF & "Enter your password.", "", "*")
                    
Run("truecrypt.exe /l " & $Found & "/m /a /q, 1, true /v encrypted.tc /p " & $passwd)

What I'm Trying

$passwd = InputBox("Security Check", "This is a secure device and should only be used by the owner." & @CRLF & " " & @CRLF & " " & @CRLF & "Enter your password.", "", "*")

If @error = 1 Then
    MsgBox(0,"Error","Cancel")
Else

; Continue script
the cancel button return 2

$a = msgBox(1,"","Cancel")

if $a == 2 then msgBox(0,"","press cancel Button")

Link to comment
Share on other sites

Thanks Guys for the quick response.

I managed to get it working with the following code.

Thanks again for the help

$passwd = InputBox("Security Check", "This is a secure device and should only be used by the owner." & @CRLF & " " & @CRLF & " " & @CRLF & "Enter your password.", "", "*")

If @error = 1 Then
    MsgBox(0,"Error","Cancel")
Else
    Run("truecrypt.exe /l " & $Found & "/m /a /q, 1, true /v encrypted.tc /p " & $passwd)                       EndIf
Link to comment
Share on other sites

sorry... i don't understand...

this work for me...

$passwd = InputBox("Security Check", "This is a secure device and should only be used by the owner." & @CRLF & " " & @CRLF & " " & @CRLF & "Enter your password.", "", "*")

If @error = 1 Then
    MsgBox(0,"Error","Cancel")
ElseIf $passwd == "" Then
MsgBox(0,"","Empty field")
Else
MsgBox(0,"","Continue script -- digit= "&$passwd)
EndIf
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...