Jump to content
Sign in to follow this  

Show password

Recommended Posts


i have a edit box that is used for a password.

i have it so that when it is not selected and there is no text in the box, it should say 'Password'

but it shows it as a password, with the dots

heres is a clip of what i have.

Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam)
    Local $hWndFrom, $iIDFrom, $iCode
    Local $input1
    $hWndEdit1 = GUICtrlGetHandle($input)
    $hWndFrom = $ilParam
    $iIDFrom = _WinAPI_LoWord($iwParam)
    $iCode = _WinAPI_HiWord($iwParam)
    Switch $hWndFrom
        Case $hWndEdit1
            Switch $iCode
                Case $EN_KILLFOCUS
                    If _GUICtrlEdit_GetTextLen($input) = 0 Then
                        GUICtrlSetData($input, "Password" )
                        GUICtrlSetStyle($input, ); what goes here?
                        GUICtrlSetColor($input, 0x808080)
                Case $EN_SETFOCUS    
                     If GUICtrlRead($input) = "Password" Then
                        GUICtrlSetData($input, "")
                        GUICtrlSetStyle($input, $ES_PASSWORD)
                        GUICtrlSetColor($input, 0x000000)
                Case $EN_CHANGE
Edited by billthecreator

[font=Microsoft Sans Serif]My Scripts: From Most recent to least.[/font]Countdown GUI | QLOCK TWO | FlipClock | Slot Machine My UDF:_GenerateRandomNoRepeat | _GuiSnap

Share this post

Link to post
Share on other sites

I want the same thing, show the word Password there.

If the user select to write this should remove the word Password and leave the input empty and when user input a password show dots.

Also I want the combo as read only, but I can't take it done.

#include <ButtonConstants.au3>
#include <ComboConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=form1.kxf
$Form1_1 = GUICreate("Program", 301, 351, 350, 168)
$Pic1 = GUICtrlCreatePic("app_logo.gif", 96, 24, 110, 32, BitOR($SS_NOTIFY,$WS_GROUP,$WS_CLIPSIBLINGS))
$Label1 = GUICtrlCreateLabel("text 1", 36, 88, 235, 17)
GUICtrlSetCursor (-1, 0)
$Label2 = GUICtrlCreateLabel("text 2", 36, 111, 235, 17)
GUICtrlSetCursor (-1, 0)
$Label3 = GUICtrlCreateLabel("text 3", 36, 134, 235, 17)
GUICtrlSetCursor (-1, 0)
$Label4 = GUICtrlCreateLabel("text 4", 36, 157, 235, 17)
GUICtrlSetCursor (-1, 0)
$Combo1 = GUICtrlCreateCombo("Choose your site...", 96, 248, 121, 25)
GUICtrlSetData(-1, "first|second")
GUICtrlCreateInput("name@email.com", 96, 192, 121, 21, BitOR($ES_AUTOHSCROLL,$ES_READONLY))
GUICtrlCreateInput("Password", 96, 216, 121, 21, BitOR($ES_PASSWORD,$ES_AUTOHSCROLL))
$OK = GUICtrlCreateButton("OK", 120, 304, 75, 25, 0)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg

Case $OK

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