Jussip Posted September 6, 2008 Share Posted September 6, 2008 Hey, im new at autoit, and i need bit help.How i can set a password, if you type it wrong, it send msg like "Wrong password",and if i type it right it sends "Right Password"?This is the script:#include <GUIConstants.au3>$Form1 = GUICreate("Enter Password", 283, 112, -1, -1)GUISetIcon("D:\008.ico")$PasswordEdit = GUICtrlCreateInput("password", 9, 34, 251, 22, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE))$ButtonOk = GUICtrlCreateButton("&OK", 93, 69, 80, 27, 0)$ButtonCancel = GUICtrlCreateButton("&Cancel", 180, 69, 81, 27, 0)$EnterPassLabel = GUICtrlCreateLabel("Enter password ", 9, 13, 93, 18, BitOR($SS_CENTERIMAGE,$SS_RIGHTJUST))GUISetState(@SW_SHOW)While 1$nMsg = GUIGetMsg()Switch $nMsgCase $GUI_EVENT_CLOSEExitEndSwitchWEnd Link to comment Share on other sites More sharing options...
Andreik Posted September 6, 2008 Share Posted September 6, 2008 Hey, im new at autoit, and i need bit help. How i can set a password, if you type it wrong, it send msg like "Wrong password", and if i type it right it sends "Right Password"? This is the script: #include <GUIConstants.au3> $Form1 = GUICreate("Enter Password", 283, 112, -1, -1) GUISetIcon("D:\008.ico") $PasswordEdit = GUICtrlCreateInput("password", 9, 34, 251, 22, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE)) $ButtonOk = GUICtrlCreateButton("&OK", 93, 69, 80, 27, 0) $ButtonCancel = GUICtrlCreateButton("&Cancel", 180, 69, 81, 27, 0) $EnterPassLabel = GUICtrlCreateLabel("Enter password ", 9, 13, 93, 18, BitOR($SS_CENTERIMAGE,$SS_RIGHTJUST)) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Try this: #include <GUIConstants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Enter Password", 283, 112, -1, -1) $PasswordEdit = GUICtrlCreateInput("password", 9, 34, 251, 22, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL), BitOR($WS_EX_CLIENTEDGE,$WS_EX_STATICEDGE)) $ButtonOk = GUICtrlCreateButton("&OK", 93, 69, 80, 27, 0) $ButtonCancel = GUICtrlCreateButton("&Cancel", 180, 69, 81, 27, 0) $EnterPassLabel = GUICtrlCreateLabel("Enter password ", 9, 13, 93, 18, BitOR($SS_CENTERIMAGE,$SS_RIGHTJUST)) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $ButtonOk If GUICtrlRead($PasswordEdit) = "password" Then MsgBox(0,"","Correct password") Else MsgBox(0,"","Wrong password") Exit EndIf Case $ButtonCancel Exit Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd When the words fail... music speaks. Link to comment Share on other sites More sharing options...
Jussip Posted September 6, 2008 Author Share Posted September 6, 2008 Thanks, it worked =) Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 6, 2008 Share Posted September 6, 2008 Hey, im new at autoit, and i need bit help.Welcome to AutoIt.Don't double post on the Forum. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law 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