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

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

Аватара для ferget

Разный


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

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


Код: Выделить весь код
#include <GUIConstantsEx.au3>
$sUserName = 'Pozia'
$sNewUserName = ''
Global $iTime_Expired = 0, $iTime_Counter = 100
Global $iWidth = 292, $iHeight = 150
$hGUI = GUICreate('Seven x64', $iWidth, $iHeight)
GUISetBkColor(0xBEBEBE) ;цвет окна
GUICtrlCreateLabel('Введи желаемое имя учетной записи ''Администратор''', 10, 10)
GUICtrlCreateLabel('', 10, 30)
$nNewUserName = GUICtrlCreateInput ($sUserName, 10, 70, 268, 20)
$nYes_Button = GUICtrlCreateButton('Ok', 10, 100, 130)
$nNo_Button = GUICtrlCreateButton('Cancel', 150, 100, 130)
GUISetState(@SW_SHOW, $hGUI)
_Set_YesButton_Timer_Proc()
AdlibRegister('_Set_YesButton_Timer_Proc', 1000)
While 1
    $vMsg = GUIGetMsg()
    If $iTime_Expired Then $vMsg = $nYes_Button
    Switch $vMsg
        Case $nNo_Button, $GUI_EVENT_CLOSE
            Exit
        Case $nYes_Button
            AdlibUnRegister() ;Отключение функции отсчёта
            $sNewUserName = GUICtrlRead($nNewUserName)
			GUIDelete($hGUI) ;Удаление окна
            ConsoleWrite($sNewUserName & @LF)
            If Not $sNewUserName Then Exit
            RunWait('renuser.exe Pozia "' & $sNewUserName & '"')
            Exit
    EndSwitch
WEnd
Func _Set_YesButton_Timer_Proc()
    GUICtrlSetData($nYes_Button, 'Ok (' & $iTime_Counter & ')')
    $iTime_Counter -= 1
    If $iTime_Counter < 0 Then
        AdlibUnRegister()
        $iTime_Expired = 1
    EndIf
EndFunc
exit
Это сообщение посчитали полезным следующие участники:

Отправлено: 02:33, 17-07-2012 | #16