Jump to content

GUI


mist3r
 Share

Recommended Posts

Ok, this is a small fragment of the big picture.

I've got enough install scripts for small applications and checks for the pc's I have to manage at work. Now im wanting to make 1 big program/script to manage the rest of the scripts. Basically an installer to run each script depending on which boxes the user selects.

First things first... check this out. baring in mind this is the very first time i've used the GUI functions :P

#include <GUIConstants.au3>
$Form1 = GUICreate("Installation Form", 220,140)
$ck1 = GUICtrlCreateCheckbox("Change Room Location", 40, 10, 300, 20)
$ck2 = GUICtrlCreateCheckbox("Install Proxy", 40, 30, 250, 20)
$btn = GUICtrlCreateButton( "Install", 40, 80, 100, 35) 
GUISetState()
While 1
    $msg = GuiGetMsg()
    Select
    Case $msg = $GUI_EVENT_CLOSE
        ExitLoop
    Case $msg = $btn
        If GUICtrlRead($ck1) = $GUI_CHECKED then

        ; Script Start - Change ROOM location
        RegWrite ( "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment" ,"LOCATION", "REG_SZ", "607" )
        $newLocation = RegRead( "HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment" ,"LOCATION")
        msgbox(0,"","" & $newLocation & "")
    EndIf
    If GUICtrlRead($ck2) = $GUI_CHECKED then
        ;Proxy Checker
        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyServer", "REG_SZ", "proxy.embc.org.uk:80")
        RegWrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable", "REG_DWORD", "1")
    Endif
    Case Else   
       ;;;;;;;
    EndSelect
WEnd
Exit
oÝ÷ ØÚ0hî²Ü(׫x"~Øb²+-êâpk&¢ë]¢)àÒ/y©ky§rmë®*m²ájwZ²Ç©z¶­yø¥zƧ˲Z¥v+[yæ¬êí¡ì^q«­¢+ÙèÀäÈíÁÑ ÀäÈíѼÀäÈíÕѽ¥Ð¹áÍÉ¥ÁÐĹÔÌí¥¹Íѱ°ÁɽɴÄ)èÀäÈíÁÑ ÀäÈíѼÀäÈíÕѽ¥Ð¹áÍÉ¥ÁÐȹÔÌí¥¹Íѱ°ÁɽɴÈ(

rather then copying the existing script text into the over all script?

Also any error reporting ideas please incase 1 installation fails that it will carry on or something?

Thanks, any advice appreciated!! :D

:)

Link to comment
Share on other sites

Ah brillient! :)

Yus thanks

.

Also, im thinking of making it detect if somethings already there and checking the box for the user on load.

Im reading up on styles and im finding the examples in the help file alot more difficult then the rest when it comes to GUICtrlSetData.

;Checks
$regCheck = RegRead("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "ProxyEnable")
if $regCheck = 1 Then
    GUICtrlSetData(4,"Checkbox", 1)
Endif

All very confused. Especially making a checkbox ticked initially if that program or setting is already inplace.

How's GUI Control Styles actually used within a script? Sorry for all the n00bish questions. :P Thanks again and well played Manadar

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...