brian873 Posted August 29, 2007 Share Posted August 29, 2007 (edited) 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 ?ThanksOriginal 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 August 29, 2007 by brian873 Link to comment Share on other sites More sharing options...
Bert Posted August 29, 2007 Share Posted August 29, 2007 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. The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
silvano Posted August 29, 2007 Share Posted August 29, 2007 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 More sharing options...
brian873 Posted August 29, 2007 Author Share Posted August 29, 2007 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 More sharing options...
silvano Posted August 29, 2007 Share Posted August 29, 2007 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 More sharing options...
brian873 Posted August 29, 2007 Author Share Posted August 29, 2007 Yeah I had forgot the ENDIF ! Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now