给段代码你参考下,把AutoIt3.exe放到同目录下,你的第二个问题,如果你了解什么是UDF的话就不会这么问了#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 392, 453, 192, 124)
$Edit1 = GUICtrlCreateEdit("", 8, 8, 369, 409)
GUICtrlSetData(-1, "")
$Button1 = GUICtrlCreateButton("运行", 240, 424, 75, 25)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
FileDelete("temp.au3")
FileWrite("temp.au3",GUICtrlRead($Edit1))
Run('AutoIt3.exe "'&@ScriptDir&'\temp.au3"',@ScriptDir,@SW_HIDE)
EndSwitch
WEnd
|