#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 384, 283, 192, 114)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form1Close")
$ButForInput = GUICtrlCreateButton("点这里验证", 96, 136, 209, 49)
GUICtrlSetOnEvent(-1, "ButForInputClick")
$Form2 = GUICreate("对话框", 316, 238, 282, 241)
GUISetIcon("D:\003.ico", -1)
GUISetOnEvent($GUI_EVENT_CLOSE, "Form2Close")
$GroupBox1 = GUICtrlCreateGroup("", 8, 1, 297, 193)
$Username = GUICtrlCreateInput("Username", 64, 32, 201, 21)
$Password = GUICtrlCreateInput("Password", 64, 72, 201, 21)
GUICtrlCreateGroup("", -99, -99, 1, 1)
$Button1 = GUICtrlCreateButton("确定(&O)", 65, 203, 75, 25, 0)
GUICtrlSetOnEvent(-1, "Button1Click")
$Button2 = GUICtrlCreateButton("取消(&C)", 162, 203, 75, 25, 0)
GUICtrlSetOnEvent(-1, "Button2Click")
GUISwitch($Form1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
Sleep(100)
WEnd
Func Button1Click() ;对话框中的确定
Local $UserNM,$Pwd
$UserNM=GUICtrlRead($Username)
$Pwd=GUICtrlRead($Password)
GUISwitch($Form2)
GUISetState(@SW_HIDE)
GUISwitch($Form1)
GUISetState(@SW_SHOW)
MsgBox(0,$UserNM,$Pwd)
EndFunc
Func Button2Click() ;对话框中的取消
GUISwitch($Form2)
GUISetState(@SW_HIDE)
GUISwitch($Form1)
GUISetState(@SW_SHOW)
EndFunc
Func ButForInputClick()
GUISwitch($Form2)
GUISetState(@SW_SHOW)
EndFunc
Func Form2Close()
Exit
EndFunc
Func Form1Close()
Exit
EndFunc