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

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

Аватара для Pozia

Ветеран


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

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


Iska, смог придумать так:
Код: Выделить весь код
#include <GUIConstants.au3>
Local $sUserName = "Pozia"
Local $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)
$sNewUserName = GUICtrlCreateInput ($sUserName, 10, 70 ,268 ,20)
$Yes_Button = GUICtrlCreateButton("Ok", 10, 100, 130)
$No_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 = $Yes_Button
    Switch $vMsg
        Case $No_Button, $GUI_EVENT_CLOSE
            Exit
        Case $Yes_Button
            AdlibUnRegister() ;Отключение функции отсчёта
            GUIDelete($hGUI) ;Удаление окна
            RunWait("renuser.exe Администратор " & $sNewUserName)
            Exit
    EndSwitch
WEnd
Func _Set_YesButton_Timer_Proc()
    GUICtrlSetData($Yes_Button, "Ok (" & $iTime_Counter & ")")
    $iTime_Counter -= 1
    If $iTime_Counter < 0 Then
        AdlibUnRegister()
        $iTime_Expired = 1
    EndIf
EndFunc
Но почему то вместо нужного имени учетка переименовывается в цифру 4

-------
Жизни вглядись в глаза: Это то, что ты всегда искал? Это то, что ты всегда хотел? Да или нет?


Отправлено: 20:50, 12-07-2012 | #10