Sign in to follow this  
Followers 0
MooglePower

Length Limitations of $ES_PASSWORD

8 posts in this topic

I'm coding a login box that takes a username and password and maps network drives. Everything works fine but when certain users with long passwords (approximately 25 characters or more) log in, they are unable to because the password does not fit.

The code that creates the password box currently looks like this:

$thepasswordfield = GUICtrlCreateInput("",75,60,150,20,$ES_PASSWORD)

I've set up a test in which I have a dialog box containing the password pop up after the users click the "Login" button. This produces very different results when the $ES_PASSWORD flag is present and when it is absent. When I don't include it in my GUICtrlCreateInput statement, the correct password shows up in the dialog box but the password is unmasked in the input field. When I do include it, the password is masked in the input field but the dialog box displays a truncated password.

Is there any way to increase the maximum length of the input field when the $ES_PASSWORD flag is present? Thank you!

Share this post


Link to post
Share on other sites



Trz GUICtrlSetLimit

1 person likes this

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites

I tried the following:

GUICtrlSetLimit($thepasswordfield,255)

Unfortunately, the same thing happens.

Share this post


Link to post
Share on other sites

Hm, I have no problems with this sample code:

GUICreate("Test")
$Pwd = GUICtrlCreateInput("", 10, 10, 300, 20, 0x0020)
GUISetState()

Local $msg
Do
 $msg = GUIGetMsg()
 If $msg = $Pwd Then ConsoleWrite(GUICtrlRead($Pwd))
Until $msg = -3

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites

Okay, I see what's going on. Since I have hard-coded the width in at 150, this is limiting the number of characters that can be typed into the field somehow. I want it to appear to be 150 long, but the one in your example is 300 long and therefore has a longer limit.

So, my new question is such: is there any way of making the actual length of the field longer while keeping the appearance small?

Hm, I have no problems with this sample code:

GUICreate("Test")
$Pwd = GUICtrlCreateInput("", 10, 10, 300, 20, 0x0020)
GUISetState()

Local $msg
Do
 $msg = GUIGetMsg()
 If $msg = $Pwd Then ConsoleWrite(GUICtrlRead($Pwd))
Until $msg = -3

Share this post


Link to post
Share on other sites

Use $ES_AUTOHSCROLL

GUICreate("Test")
Local $hPwd = GUICtrlCreateInput("", 10, 10, 150, 20, BitOR(0x0020, 0x0080))
GUISetState()

Local $msg, $pwd
Do
 $msg = GUIGetMsg()
 If $msg = $hPwd Then
  $pwd = GUICtrlRead($hPwd)
  ConsoleWrite(StringLen($pwd) & " - " & $pwd & @CR)
 EndIf
Until $msg = -3

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites

I guess I should clarify here. I'd really like to have an input box of unlimited length that has the $ES_PASSWORD flag. Unfortunately, when I set the $ES_PASSWORD flag, the box seems to be limited by the length of the physical input box as it appears on the screen. Is there any way to remove this limitation? Some people have some very long passwords and having a text field that takes up most of the screen is impractical. Thank you!

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  
Followers 0