#include <ButtonConstants.au3>
#include <GuiMenu.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
ObjCreate("AutoItX3.Control")
If @error Then
MsgBox(16,"Error!","AutoItX3 not registered!")
$sMsg = MsgBox(36,"AutoItX3 not registered!","You want to register AutoItX3?")
If $sMsg = 7 Then Exit
If FileExists(@ScriptDir & "\AutoItX3.dll") Then
_RegServ32()
If Not @error Then MsgBox(64,"Ok!","AutoItX3 Registered!")
Else
$s_Dll = FileOpenDialog("Регистрация Dll", @ScriptDir & "\", "DLL (*.dll)")
If @error Then Exit
_RegServ32($s_Dll)
If Not @error Then MsgBox(64,"Ok!","AutoItX3 Registered!")
EndIf
EndIf
#Region GUI
$Form1 = GUICreate("AutoIt + PHP", 166, 90, (@DesktopWidth - 166) / 2, (@DesktopHeight - 90) / 2, -1, BitOR($WS_EX_TOOLWINDOW,$WS_EX_WINDOWEDGE))
$LText = GUICtrlCreateLabel("TIME:", 14, 19, 33, 17)
$LTimer = GUICtrlCreateLabel("0.0", 50, 19, 103, 17)
$Button = GUICtrlCreateButton("Старт!", 45, 51, 75, 25, 0)
GUISetState(@SW_SHOW)
#EndRegion GUI
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button
If ControlGetText("AutoIt + PHP", "", $Button) = "Сброс..." Then
ControlSetText("", "", $LTimer, "0.0")
ControlSetText("", "", $Button, "Старт!")
ContinueLoop
EndIf
ControlDisable("AutoIt + PHP", "", $Button)
_Timer()
EndSwitch
WEnd
#Region Function
Func _RegServ32($s_Dll = "AutoItX3.dll")
DllCall($s_Dll, "long", "DllRegisterServer")
If @error Then MsgBox(16, Default, @error)
Return SetError(0)
EndFunc
Func _UnRegServ32($s_Dll = "AutoItX3.dll")
DllCall($s_Dll, "long", "DllUnregisterServer")
If @error Then MsgBox(16, Default, @error)
Return SetError(0)
EndFunc
Func _Timer()
$s_File = @ScriptDir & "\php_autoitx.exe"
If Not FileExists($s_File) Then
MsgBox(16,"Error!","File time.exe not at directory " & $s_File)
Exit
EndIf
Run($s_File)
ControlSetText("", "0.0", $LTimer, "Ждём...")
EndFunc
#EndRegion Function