函数参考


_GUICtrlEdit_GetPasswordChar

获取编辑控件显示当用户输入文本的密码字符

#include <GuiEdit.au3>
_GUICtrlEdit_GetPasswordChar($hWnd)

参数

$hWnd 控件的控件ID/句柄

返回值

成功: 返回用户输入字符的显示字符
    如果返回值 为 0,表明没有密码字符,该控件直接显示用户输入的字符.

注意/说明

None.

相关

_GUICtrlEdit_SetPasswordChar

示例/演示


#include <GuiEdit.au3>
#include <GUIConstantsEx.au3>

$Debug_Ed = False ; Check ClassName being passed to Edit functions, set to True and use a handle to another control to see it work

_Main()

Func _Main()
    Local $hEdit

    ; 创建 GUI
    GUICreate("Edit Get Password Char", 400, 300)
    $hEdit = GUICtrlCreateInput("Test of build-in control", 2, 2, 394, 25, $ES_PASSWORD)
    GUISetState()

    MsgBox(4096, "信息", "Password Char: " & _GUICtrlEdit_GetPasswordChar($hEdit))

    _GUICtrlEdit_SetPasswordChar($hEdit, "$") ; change password char to $

    MsgBox(4096, "信息", "Password Char: " & _GUICtrlEdit_GetPasswordChar($hEdit))

    _GUICtrlEdit_SetPasswordChar($hEdit) ; display characters typed by the user.

    MsgBox(4096, "信息", "Password Char: " & _GUICtrlEdit_GetPasswordChar($hEdit))

    ; 循环直到用户退出
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
    GUIDelete()
EndFunc   ;==>_Main