#include <GUIConstantsEx.au3>
Func Terminate()
Exit
EndFunc
HotKeySet("{ESC}", "Terminate")
Local $hGUI = GUICreate("Example", 300, 200)
Local $idInput = GUICtrlCreateInput("12345", 120, 170, 85, 25)
Local $idButton = GUICtrlCreateButton("run", 210, 170, 85, 25)
GUISetState(@SW_SHOW, $hGUI)
While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case $idButton
$txt = GUICtrlRead($idInput)
GUISetState(@SW_HIDE, $hGUI)
run("notepad")
Local $hWnd = WinWait("[CLASS:Notepad]", "", 10)
ControlFocus($hWnd, "", "Edit1")
While 1
Send($txt)
Send("{Enter}")
wend
EndSwitch
WEnd
GUIDelete($hGUI)
|