#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <ButtonConstants.au3> Opt('GUIResizeMode', $GUI_DOCKMENUBAR) ;Opt('GUIResizeMode', 544) ; Opt('GUIResizeMode', 802) ; -------------------------------------------------- ; таймер. Global $iCountdown = 10, _ ; 10 sec $fTimer = True ; -------------------------------------------------- Global $hForm = GUICreate('', 300, 110, -1, -1, -1, $WS_EX_TOPMOST) Global $nLabel = GUICtrlCreateLabel('До автозапуска осталось: ' & $iCountdown & ' сек.', 20, 3, 270, 20) $nButtonOK = GUICtrlCreateButton('ОК', 240, 20, 40, 20, $BS_DEFPUSHBUTTON) $nButtonStop = GUICtrlCreateButton('Стоп', 240, 50, 40, 20, $BS_DEFPUSHBUTTON) ;$ButtonPos = GUICtrlCreateButton(ChrW(0x25BC), 240, 80, 40, 20, $WS_GROUP) ;GUICtrlSetFont(-1, -1, -1, -1, 'Arial') ;$nButtonPos = GUICtrlCreateButton('Ъ', 240, 80, 40, 20, $WS_GROUP);Ъ;к;т;Ю $nButtonDown = GUICtrlCreateButton('Ъ', 240, 80, 40, 20, $WS_GROUP);Ъ;к;т;Ю GUICtrlSetFont(-1, 12, -1, -1, 'Wingdings') $nButtonUp = GUICtrlCreateButton('Щ', 240, 80, 40, 20, $WS_GROUP);Щ;й;с;Э GUICtrlSetFont(-1, 12, -1, -1, 'Wingdings') GUICtrlSetState(-1, $GUI_HIDE) Global $nUser1 = GUICtrlCreateInput('', 20, 20, 200, 20) Global $nUser2 = GUICtrlCreateInput('', 20, 50, 200, 20) Global $nUser3 = GUICtrlCreateInput('', 20, 80, 200, 20) Global $nUser4 = GUICtrlCreateInput('', 20, 110, 200, 20) Global $nUser5 = GUICtrlCreateInput('', 20, 140, 200, 20) Global $nUser6 = GUICtrlCreateInput('', 20, 170, 200, 20) WinSetTrans($hForm, '', 0) GUISetState() For $i = 0 To 255 Step 5 WinSetTrans($hForm, '', $i) Sleep(5) Next $iStart = TimerInit() While 1 ; -------------------------------------------------- ; таймер. ;Sleep(100) ;$Countdown -= 1 ;If Not StringInStr($Countdown / 10, '.') And $Countdown >= 0 Then GUICtrlSetData($Lable, 'До автозапуска осталось: ' & $Countdown / 10 & ' сек.') ;If $Countdown = 0 Then Exit ; -------------------------------------------------- If $fTimer Then If TimerDiff($iStart) >= 1000 Then $iCountdown -= Int(TimerDiff($iStart) / 1000) If $iCountdown < 0 Then _Exit() GUICtrlSetData($nLabel, 'До автозапуска осталось: ' & $iCountdown & ' сек.') $iStart = TimerInit() EndIf EndIf $nMsg = GUIGetMsg() Switch $nMsg Case $nButtonStop ;---не совсем понял, что значит "щёлкнуть мышкой в поле GUICtrlCreateInput", может так? GUICtrlSetState(Eval('nUser' & Random(1, 3, 1)), $GUI_FOCUS) ;--- ;-----Таймер просто останавливается: ;$fTimer = False ;GUICtrlSetData($nLabel, 'Таймер остановлен.');? ;-----Таймер ставится на паузу: $fTimer = Not $fTimer If $fTimer Then GUICtrlSetData($nButtonStop, 'Стоп') $iStart = TimerInit() Else GUICtrlSetData($nButtonStop, 'Старт') EndIf Case $nButtonOK ; _WriteUser() ; DllCall('User32.dll','long','AnimateWindow','hwnd',$Form,'long',300,'long',0x10+0x10000) ;Exit _Exit() ;Case $nButtonPos ; $aGuiPos = WinGetPos($hForm) ; If $aGuiPos[3] > 100 And $aGuiPos[3] < 150 Then ; WinMove($hForm, '', $aGuiPos[0], $aGuiPos[1], $aGuiPos[2], $aGuiPos[3] + 100) ; ;GUICtrlSetData($ButtonPos, ChrW(0x25B2)) ; GUICtrlSetData($nButtonPos, 'Щ');Щ;й;с;Э ; GUICtrlSetPos($nButtonPos, 240, 170, 40, 20) ; GUICtrlSetTip($nButtonPos, 'Скрыть список') ; Else ; WinMove($hForm, '', $aGuiPos[0], $aGuiPos[1], $aGuiPos[2], $aGuiPos[3] - 100) ; ;GUICtrlSetData($ButtonPos, ChrW(0x25BC)) ; GUICtrlSetData($nButtonPos, 'Ъ');Ъ;к;т;Ю ; GUICtrlSetPos($nButtonPos, 240, 80, 40, 20) ; GUICtrlSetTip($nButtonPos, 'Раскрыть список') ; EndIf Case $nButtonDown $aGuiPos = WinGetPos($hForm) WinMove($hForm, '', $aGuiPos[0], $aGuiPos[1], $aGuiPos[2], $aGuiPos[3] + 100) GUICtrlSetState($nButtonDown, $GUI_HIDE) GUICtrlSetState($nButtonUp, $GUI_SHOW) Case $nButtonUp $aGuiPos = WinGetPos($hForm) WinMove($hForm, '', $aGuiPos[0], $aGuiPos[1], $aGuiPos[2], $aGuiPos[3] - 100) GUICtrlSetState($nButtonUp, $GUI_HIDE) GUICtrlSetState($nButtonDown, $GUI_SHOW) Case $GUI_EVENT_CLOSE ; DllCall('User32.dll','long','AnimateWindow','hwnd',$Form,'long',300,'long',0x10+0x10000) ;Exit _Exit() EndSwitch WEnd Func _Exit() For $i = 255 To 0 Step -5 WinSetTrans($hForm, '', $i) Sleep(5) Next Exit EndFunc ;==>_Exit |