回复 15# qsy666888
晚安!#include <GUIConstantsEx.au3>
#include <Editconstants.au3>
#include <WindowsConstants.au3>
;Global $EM_SETPASSWORDCHAR = 0xCC
GUICreate("Test", 350, 98, 192, 124)
$input_qq = GUICtrlCreateInput("请输入qq号码", 88, 62, 201, 21)
$input_pw = GUICtrlCreateInput('请输入密码', 88, 32, 201, 21)
GUIRegisterMsg($WM_COMMAND, 'WM_COMMAND')
GUISetState()
While 1
If GUIGetMsg() = -3 Then ExitLoop
WEnd
Func WM_COMMAND($hWnd, $msg, $wParam, $lParam)
Local $iCode = BitShift($wParam, 16)
Switch $lParam
Case GUICtrlGetHandle($input_pw)
Switch $iCode
Case $EN_KILLFOCUS
If GUICtrlRead($input_pw) == '' Then GUICtrlSetData($input_pw, '请输入密码')
If GUICtrlRead($input_pw) = '请输入密码' Then
GUICtrlSendMsg($input_pw, $EM_SETPASSWORDCHAR, 0, 0)
EndIf
Case $EN_SETFOCUS
If GUICtrlRead($input_pw) = '请输入密码' Then GUICtrlSetData($input_pw, '')
GUICtrlSendMsg($input_pw, $EM_SETPASSWORDCHAR, 42, 0)
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc
|