#include <GUIConstants.au3>
#include <file.au3>
Opt("GUICoordMode", 1)
GUICreate("CASSE DEMO", 400,280)
; Create the controls
$button_1 = GUICtrlCreateButton ("CASSA 1", 150, 50, 120, 40)
$button_2 = GUICtrlCreateButton ("CASSA 2", 150, 125, 120, 40)
$button_3 = GUICtrlCreateButton ("CHIUDI", 150, 200, 120, 40)
; Show the GUI
GUISetState ()
; In this message loop we use variables to keep track of changes to the radios, another
; way would be to use GUICtrlRead() at the end to read in the state of each control
While 1
$msg = GUIGetMsg()
Select
Case $msg = $button_3
MsgBox(0, "", "PROGRAMMA VERRA TERMINATA")
ProcessClose("SoEcrCom.exe")
Exit
Case $msg = $GUI_EVENT_CLOSE
MsgBox(0, "", "PROGRAMMA VERRA TERMINATA")
ProcessClose("SoEcrCom.exe")
Run ( "C:\Program Files\Ditron\WinEcrCom 1.9\Utilities\WinEcrConf.exe" )
Exit
Case $msg = $GUI_EVENT_MINIMIZE
MsgBox(0,"", "Dialog minimized",2)
Case $msg = $GUI_EVENT_MAXIMIZE
MsgBox(0,"", "Dialog restored",2)
Case $msg = $button_1
FileCopy ("C:\sxdir\INVIO DATI\input.txt", "C:\sxdir\")
ProcessClose("SoEcrCom.exe")
Run ( "C:\Program Files\Ditron\WinEcrCom 1.9\Utilities\WinEcrConf.exe")
WinWaitActive("WinEcrConf","","1")
Send("{TAB 7}")
Send("1")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{ENTER}")
ProcessClose("WinEcrConf.exe")
Run ( "C:\Program Files\Ditron\WinEcrCom 1.9\Drivers\SoEcrCom.exe" )
$file = "C:\sxdir\input.txt";@ScriptDir & '\file.txt'
$timeout = 1000 ; Проверка файла каждые 1 секунд...
While 1
Sleep($timeout)
If Not FileExists($file) Then
MsgBox(48, 'Message', 'DATI INVIATI')
ExitLoop
EndIf
WEnd
;Exit(0)
$PID = ProcessExists("WinEcrConf.exe") ; Will return the PID or 0 if the process isn't found.
If $PID Then ProcessClose($PID)
Case $msg = $button_2
FileCopy ("C:\sxdir\INVIO DATI\input.txt", "C:\sxdir\")
ProcessClose("SoEcrCom.exe")
Run ( "C:\Program Files\Ditron\WinEcrCom 1.9\Utilities\WinEcrConf.exe")
WinWaitActive("WinEcrConf","","1")
Send("{TAB 7}")
Send("2")
Send("{TAB}")
Send("{TAB}")
Send("{TAB}")
Send("{ENTER}")
ProcessClose("WinEcrConf.exe")
Run ( "C:\Program Files\Ditron\WinEcrCom 1.9\Drivers\SoEcrCom.exe" )
Run ( "C:\Program Files\Ditron\WinEcrCom 1.9\Drivers\SoEcrCom.exe" )
$file = "C:\sxdir\input.txt";@ScriptDir & '\file.txt'
$timeout = 1000 ; Проверка файла каждые 1 секунд...
While 1
Sleep($timeout)
If Not FileExists($file) Then
MsgBox(48, 'Message', 'DATI INVIATI')
ExitLoop
EndIf
WEnd
EndSelect
WEnd