Имя пользователя:
Пароль:
 

Показать сообщение отдельно

Аватара для Creat0R

Must AutoIt


Сообщения: 3054
Благодарности: 1009

Профиль | Сайт | Отправить PM | Цитировать


Цитата Pozia:
как сделать чтобы после появления окна на кнопке Да появился обратный отсчет 30 сек »
Код: Выделить весь код
#include <GUIConstants.au3>

Global $iTime_Expired = 0, $iTime_Counter = 30
Global $iWidth = 300, $iHeight = 100

$hGUI = GUICreate("Title", $iWidth, $iHeight)
GUISetBkColor(0xBEBEBE) ;цвет окна

GUICtrlCreateLabel("Установить?", 10, 20)

$Yes_Button = GUICtrlCreateButton("Да", 10, 60, 60)
$No_Button = GUICtrlCreateButton("Нет", 80, 60, 60)

GUISetState(@SW_SHOW, $hGUI)

_Set_YesButton_Timer_Proc()
AdlibEnable("_Set_YesButton_Timer_Proc", 1000)

While 1
    $vMsg = GUIGetMsg()

    If $iTime_Expired Then $vMsg = $Yes_Button

    Switch $vMsg
        Case $No_Button, $GUI_EVENT_CLOSE
            Exit
        Case $Yes_Button
            AdlibDisable() ;Отключение функции отсчёта
            GUIDelete($hGUI) ;Удаление окна

            MsgBox(0, "", "Запустился ваш код!")

            If Not FileExists(@SystemDir & "\PS.ini") Then Exit

            RunWait("WSidebar.exe /VERYSILENT")
            DirRemove(@ProgramFilesDir & "\Windows Sidebar\Gadgets", 1)

            Run(@ComSpec & ' /c xcopy settings.ini ' & _
                '"%UserProfile%\Local Settings\Application Data\Microsoft\Windows Sidebar\" /S /H /Y', '', @SW_HIDE)

            Run(@ComSpec & ' /c xcopy Gadgets "%ProgramFiles%\Windows Sidebar\Gadgets\" /S /H /Y', '', @SW_HIDE)

            RunWait("WLMAIL.exe")
            RunWait("REGEDIT /S WLMAIL.reg")

            Exit
    EndSwitch
WEnd

Func _Set_YesButton_Timer_Proc()
    GUICtrlSetData($Yes_Button, "Да (" & $iTime_Counter & ")")

    $iTime_Counter -= 1

    If $iTime_Counter < 0 Then
        AdlibDisable()
        $iTime_Expired = 1
    EndIf
EndFunc

-------
“Сделай так просто, как возможно, но не проще этого.”... “Ты никогда не решишь проблему, если будешь думать так же, как те, кто её создал.”

Альберт Эйнштейн

P.S «Не оказываю техподдержку через ПМ/ICQ, и по email - для этого есть форум. ©»

http://creator-lab.ucoz.ru/Images/Icons/autoit_icon.png Русское сообщество AutoIt | http://creator-lab.ucoz.ru/Images/Ic...eator_icon.png CreatoR's Lab | http://creator-lab.ucoz.ru/Images/Icons/oac_icon.png Opera AC Community

Это сообщение посчитали полезным следующие участники:

Отправлено: 01:31, 02-04-2009 | #10