Jump to content

GUI


Recommended Posts

variables are defined with the $ sign in auto IT

so, in batch:

set var=Hello World !

echo. %var%

in AutoIT:

$var = "hello World !"

msgbox(0, "Hello World", $var)

To set a variable to an input on a GUI:

$var = GUICreateInput("define deatils for input here)

and you will have to GUICtrlRead($var) to get the value that the user has typed.

check the examples on the functions i have noted in the helpfile for more information.

Link to comment
Share on other sites

Hi i am making a GUI.

how do i make Var's?

i want a input box on my GUI that makes it a var and it will do it e.g

Which reg do you want to del [ ]

What do you want admin password to be [ ] (Var pass

and the code i need to send it

Send ("%1%")

Your question is a little confusing. Do do you want a button that give you an input box or something like that?

See if this will help you.

#include <GUIConstants.au3>

$AppTitle = "My Gui"
$MyGui = GUICreate("MyGui", 395, 229, -1, -1)
$RegInput = GUICtrlCreateInput("", 192, 32, 153, 21)
$RegLabel = GUICtrlCreateLabel("What reg do you want to delete?", 16, 35, 159, 17)
$PassInput = GUICtrlCreateInput("", 248, 72, 129, 21)
$PassLabel = GUICtrlCreateLabel("What do you want your admin password to be?", 16, 75, 226, 17)
$RegChk = GUICtrlCreateButton("RegChk", 66, 136, 113, 49, 0)
$PassChk = GUICtrlCreateButton("PassChk", 228, 136, 113, 49, 0)
GUISetState(@SW_SHOW)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $RegChk
        $RegStatus = GUICtrlRead($RegInput)
        MsgBox(64, $AppTitle, "Reg key to be deleted is - " & $RegStatus)
        Case $PassChk
        $PassStatus = GUICtrlRead($PassInput)
        MsgBox(64, $AppTitle, "Password set to - " & $PassStatus)
    EndSwitch
WEnd
EndFuncAutoIt is the shiznit. I love it.
Link to comment
Share on other sites

i just want a here is my script so far V 1.3

; AutoIt 3.0.103 example

; 17 Jan 2005 - CyberSlug

; This script shows manual positioning of all controls;

; there are much better methods of positioning...

#include <GuiConstants.au3>

; GUI

GuiCreate("Win Utilitys", 525, 300)

GuiSetIcon("WinUtilitys.exe")

Opt("GUICoordMode",2)

GUICtrlCreateLabel ("Version 1.3", 15, 35, 100)

$Button_1 = GUICtrlCreateButton ("Deletes the Wireless Policy", 15, 35, 150)

$Button_2 = GUICtrlCreateButton ("Change Admin password", 0, -1)

$Button_3 = GUICtrlCreateButton ("Change admin password to origanal - deltakilo", -300, -50, 300)

; MENU

GuiCtrlCreateMenu("File")

GUISetState ()

While 1

$msg = GUIGetMsg()

Select

Case $msg = $GUI_EVENT_CLOSE

ExitLoop

Case $msg = $Button_1

RegDelete ("HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\Wireless") ; Delte Reg

Case $msg = $Button_2

Run ("cmd.exe") ; Cmd open

Sleep (1000)

Send ("Net User Administrator *{ENTER}")

MsgBox ( 64, "WARNING", "Your are about to change Admins password")

MsgBox (64, "REMEBER", "You can change the password back via the other menu")

Case $msg = $Button_3

Run ("cmd.exe") ; Cmd open

Sleep (1000)

Send ("Net User Administrator *{ENTER}")

Sleep (500)

Send ("deltakilo{Enter}")

Sleep (500)

Send ("deltakilo{Enter}")

MsgBox ( 64, "Password set", "Password is now Normal, deltakilo")

EndSelect

Wend

; GUI MESSAGE LOOP

GuiSetState()

While GuiGetMsg() <> $GUI_EVENT_CLOSE

WEnd

As you can see i want that password chnage so in button 2 press it will take input from the gui and change the password to that, thanks

is it possable to make a .txt docuemnt to report what they have changed it to ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...