#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
Example1()
Example2()
Func Example1()
Local $msg,$Button_1,$Button_2,$open,$answer
GUICreate("abcc",650,200)
GUISetFont(25)
GUICtrlCreateLabel("1234567890",-1,-1)
GUICtrlCreateLabel("321",205,35)
$open=GUICtrlCreateInput("",185,85, 300, 35)
GUISetFont(10)
Opt("GUICoordMode", 2)
$Button_1 =GUICtrlCreateButton("确定", -1, 25, 70, 40)
GUICtrlSetState(-1, $GUI_FOCUS)
$Button_2 =GUICtrlCreateButton("取消", 0,-1)
GUISetState()
GUISetState(@SW_SHOW)
While 1
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
Exit
Case $msg = $Button_2
Exit
Case $msg = $Button_1
$answer=GUICtrlRead($open)
FileDelete(@ScriptDir&"\test.txt")
FileOpen("test.txt", 1)
FileWrite("test.txt","999")
FileWrite("test.txt",$answer)
ExitLoop
EndSelect
WEnd
GUIDelete()
EndFunc ;==>Example
Func Example2()
Local $msg2,$Button_3,$Button_4,$open2,$answer2
GUICreate("1234566",650,200)
GUISetFont(25)
GUICtrlCreateLabel("2222",-1,-1)
GUICtrlCreateLabel("333",205,35)
$open2=GUICtrlCreateInput("12345",185,85, 300, 35)
GUISetFont(10)
Opt("GUICoordMode", 2)
$Button_3 =GUICtrlCreateButton("确定", -1, 25, 70, 40)
GUICtrlSetState(-1, $GUI_FOCUS)
$Button_4 =GUICtrlCreateButton("取消", 0,-1)
GUISetState()
GUISetState(@SW_SHOW)
While 1
$msg2= GUIGetMsg()
Select
Case $msg2= $GUI_EVENT_CLOSE
Exit
Case $msg2= $Button_3
$answer2=GUICtrlRead($open2)
FileOpen("test.cmd", 1)
FileWrite("test.txt"," 222")
FileWrite("test.txt",$answer2)
ExitLoop
Case $msg2= $Button_4
Exit
EndSelect
WEnd
GUIDelete()
EndFunc