Jump to content
Sign in to follow this  
brian873

Input box

Recommended Posts

brian873

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

Share this post


Link to post
Share on other sites
Bert

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.

Share this post


Link to post
Share on other sites
silvano

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")

Share this post


Link to post
Share on other sites
brian873

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

Share this post


Link to post
Share on other sites
silvano

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

Share this post


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

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.