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

Global $window,$PassSY

Func _login()
GUISetState(@SW_DISABLE,$window)	
$login = GUICreate("用户验证", 252, 110, -1, -1, -1, -1, $window)
GUISetBkColor(0xEFF0F2)
$loginTS = GUICtrlCreateLabel("请输入密码：", 8, 12, 76, 17)
$loginMM = GUICtrlCreateInput("", 8, 38, 233, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_PASSWORD))
$loginYES = GUICtrlCreateButton("确定", 104, 72, 67, 25)
GUICtrlSetState($loginYES,$GUI_DEFBUTTON)
$loginNO = GUICtrlCreateButton("取消", 176, 72, 67, 25)
GUISetState(@SW_SHOW)


While 1
	$nMsg = GUIGetMsg()
	Switch $nMsg
		Case $GUI_EVENT_CLOSE
			_quit()
		Case $loginYES
			If GUICtrlRead($loginMM) = $PassSY Then
				GUISetState(@SW_ENABLE,$window)
				GUIDelete($login)
				ExitLoop
			ElseIf GUICtrlRead($loginMM) <> $PassSY Then
				GUICtrlSetData($loginMM,"")
			EndIf
		Case $loginNO
			_quit()

	EndSwitch
WEnd
EndFunc