#include <GuiDateTimePicker.au3>
Local $vT = IniRead('vT.ini', 'TS', 'Default', '15:12')
GUICreate('设置启动时间', 200, 120, 500, 200)
$n = GUICtrlCreateDate($vT, 20, 20, 100, 20, $DTS_TIMEFORMAT)
$hn = GUICtrlGetHandle($n)
_GUICtrlDTP_SetFormat($hn, 'HH:mm')
$bt = GUICtrlCreateButton('确定', 20, 60, 65, 26)
GUISetState()
While 1
$Msg = GUIGetMsg()
Select
Case $Msg = -3
Exit
Case $Msg = $bt
$Input = GUICtrlRead($n)
$dayq = StringSplit($Input, ":")
$aDatepc = $dayq[1] & $dayq[2]
IniWrite('vT.ini', 'TS', 'Default', GUICtrlRead($n))
;MsgBox(0, '', $aDatepc)
GUISetState(@SW_HIDE)
AdlibRegister('Spqpc', 500)
EndSelect
WEnd
Func Spqpc();收盘前清仓
ToolTip(@HOUR & ':' & @MIN & ':' & @SEC, 500, 0, "收盘前清仓")
If @HOUR & @MIN = $aDatepc Then
AdlibUnRegister()
WinActivate("雷凯投资期货交易")
Sleep(200)
Send("!q")
Sleep(30000)
Exit
EndIf
EndFunc ;==>Spqpc
|