Sign in to follow this  
Followers 0
epicfail

password input

21 posts in this topic

ok i know how to hide the letters typed into the input with $ES_PASSWORD but how would i have the input say (Enter Password) then when i click it it deletes that and then i type my password and it hides it with password dots But if i dont type anything and click out of the password input box it will come up with (Enter Password)

Share this post


Link to post
Share on other sites



but when u click on the 1 that shows (EnterPasswor) wont it just stay in that and u will still be typing in it?

Share this post


Link to post
Share on other sites

On click:

- Hide the box that the user just clicked (Enter password.. box)

- Show the box where the user should enter real password

- Put focus on the real password box

: )

And when it loses focus and has no text in it, you reverse the process.

Share this post


Link to post
Share on other sites

so something like this? but its not working

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Password Dialog", 251, 96, -1, -1)
$Input1 = GUICtrlCreateInput("Enter Password", 8, 32, 233, 21)
$PasswordEdit = GUICtrlCreateInput("password", 8, 32, 233, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
GUICtrlSetState($PasswordEdit, $GUI_HIDE)
$ButtonOk = GUICtrlCreateButton("&OK", 86, 64, 75, 25, 0)
$ButtonCancel = GUICtrlCreateButton("&Cancel", 167, 64, 75, 25, 0)
$EnterPassLabel = GUICtrlCreateLabel("Enter password", 8, 12, 77, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Input1
            GUICtrlSetState($Input1, $GUI_HIDE)
            GUICtrlSetState($PasswordEdit, $GUI_SHOW)
    EndSwitch
WEnd

Share this post


Link to post
Share on other sites

how do u do it on click?

Share this post


Link to post
Share on other sites

You check in every loop with ControlGetFocus to see if the "Enter password.." input box is checked. This information is available on the forums, found it with a Google search that took 5 seconds.

Share this post


Link to post
Share on other sites

well i cant find it on google

Share this post


Link to post
Share on other sites

well i looked 4 it and couldnt find it and i was looking before i made this topic i couldnt find anything that dose this with passwords

Share this post


Link to post
Share on other sites

yeah would u please give me the link to show me how to do this?

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

Ofcourse. Here it is: http://www.autoitscript.com/forum/index.php?showtopic=95151 .

I searched for: site:autoitscript.com GUICtrlCreateInput on click

Edited by Manadar

Share this post


Link to post
Share on other sites

thankyou

Share this post


Link to post
Share on other sites

that dont really do what i need that dose something on enter.

Share this post


Link to post
Share on other sites

No, don't you reminder my original solution? It should be on click. When you click an input box, it gets focus, what do you to check focus? Right, ControlGetFocus.

I'm going to hate myself for giving you this but I don't want to go through another 20 page discussion. Why did I even reply to this topic?

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form2 = GUICreate("Password Dialog", 251, 96, -1, -1)
$Input1 = GUICtrlCreateInput("Enter Password", 8, 32, 233, 21)
$PasswordEdit = GUICtrlCreateInput("", 8, 32, 233, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
GUICtrlSetState($PasswordEdit, $GUI_HIDE)
GUICtrlSetState($PasswordEdit, $GUI_FOCUS)
$ButtonOk = GUICtrlCreateButton("&OK", 86, 64, 75, 25, 0)
$ButtonCancel = GUICtrlCreateButton("&Cancel", 167, 64, 75, 25, 0)
$EnterPassLabel = GUICtrlCreateLabel("Enter password", 8, 12, 77, 17)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Input1
            GUICtrlSetState($Input1, $GUI_HIDE)
            GUICtrlSetState($PasswordEdit, $GUI_SHOW)
        EndSwitch
        
    If ControlGetFocus($Form2) == "Edit1" Then
        GUICtrlSetState($Input1, $GUI_HIDE)
        GUICtrlSetState($PasswordEdit, $GUI_SHOW)
        GUICtrlSetState($PasswordEdit, $GUI_FOCUS)
    EndIf
WEnd

Share this post


Link to post
Share on other sites

omg thanks so much. :D

Share this post


Link to post
Share on other sites

haha it wasnt that bad helping me out was it

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