Graeme Posted November 14, 2016 Posted November 14, 2016 I have code to enter password using the setting $ES_PASSWORD. It seems that with this setting you can't enter more than the letters that fill box. Can anyone tell me how to enter more characters? GUICreate("Password Test",500,200) $Input = GUICtrlCreateInput("Password",10,20,40,50,$ES_PASSWORD) GUISetState(@SW_SHOW,"Password Test") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUISetState(@SW_HIDE,"Password Test") ExitLoop EndSwitch WEnd If GUICtrlRead($Input) <> "" Then MsgBox(0,GUICtrlRead($Input),"Done") With this code you can only enter 4 characters of password.
water Posted November 14, 2016 Posted November 14, 2016 With using $ES_Password you have dropped all other default style values. You need to add them using something like this: #include <GUIConstantsEx.au3> #include <EditConstants.au3> GUICreate("Password Test", 500, 200) $Input = GUICtrlCreateInput("Password", 10, 20, 40, 20, BitOR($ES_PASSWORD, $ES_AUTOHSCROLL)) $OK = GUICtrlCreateButton("OK", 60, 20, 40, 20) GUISetState(@SW_SHOW, "Password Test") While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GUISetState(@SW_HIDE, "Password Test") ExitLoop Case $OK MsgBox(0, "Password", "Password has " & StringLen(GUICtrlRead($Input)) & " characters!") EndSwitch WEnd BTW: When posting code, please post a fully working script with all needed includes etc. Makes testing much easier und faster Graeme 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
kylomas Posted November 14, 2016 Posted November 14, 2016 or BitOR($ES_PASSWORD, $GUI_SS_DEFAULT_INPUT) Graeme 1 Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill
water Posted November 14, 2016 Posted November 14, 2016 Even better and more flexible Graeme 1 My UDFs and Tutorials: Spoiler UDFs: Active Directory (NEW 2024-07-28 - Version 1.6.3.0) - Download - General Help & Support - Example Scripts - Wiki ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts OutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - Wiki OutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - Download Outlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - Wiki PowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - Wiki Task Scheduler (2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs: Excel - Example Scripts - Wiki Word - Wiki Tutorials: ADO - Wiki WebDriver - Wiki
Graeme Posted November 15, 2016 Author Posted November 15, 2016 Thanks to both of you! Sorry about missing the includes.
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