#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
Example1()
Example2()
Func Example1()
Local $msg,$Button_1,$Button_2,$open,$answer
GUICreate("123",650,200,-1,-1)
GUISetFont(25)
GUICtrlCreateLabel("654879",3,5,650,30)
$open=GUICtrlCreateInput("0101",100,70, 300, 35)
GUISetFont(10)
$Button_1 =GUICtrlCreateButton("确定",120, 115, 70, 40)
GUICtrlSetState(-1, $GUI_FOCUS)
$Button_2 =GUICtrlCreateButton("取消", 260,115,70,40)
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","321")
FileWrite("test.txt",$answer)
ExitLoop
EndSelect
WEnd
GUIDelete()
EndFunc ;==>Example
Func Example2()
Local $msg2,$Button_3,$Button_4,$open2,$answer2
GUICreate("456",600,200,-1,-1)
GUISetFont(25)
GUICtrlCreateLabel("987",3,5,650,30)
$open2=GUICtrlCreateInput("abc",100,70, 300, 35)
GUISetFont(10)
$Button_3 =GUICtrlCreateButton("确定", 120, 115, 70, 40)
GUICtrlSetState(-1, $GUI_FOCUS)
$Button_4 =GUICtrlCreateButton("取消", 260,115,70,40)
GUISetState()
GUISetState(@SW_SHOW)
While 1
$msg2= GUIGetMsg()
Select
Case $msg2= $GUI_EVENT_CLOSE
Exit
Case $msg2= $Button_3
$answer2=GUICtrlRead($open2)
FileOpen("test.txt", 1)
FileWrite("test.txt"," 666")
FileWrite("test.txt",$answer2)
ExitLoop
Case $msg2= $Button_4
Exit
EndSelect
WEnd
GUIDelete()
EndFunc