lalitmp Posted August 16, 2004 Share Posted August 16, 2004 I have modified one of the script, Which I got it from this forum. I modified in such a way that it allows user to install program without admin rights. But the problem is I want to close the script when user clicks 'x' button on GUI window. Please reply if have any suggestion. Thanks, ;--------------- #include <GUIconstants.au3> WinMinimizeAll() Opt("GUICoordMode", 1) Opt("GUINotifyMode", 1) GUICreate("Radio Box Demo", 240,230,) ; Create the controls $button_1 = GUISetControl("button", "I&nstall", 130, 170, 80, 30) $group_1 = GUISetControl("group", "Group 1", 30, 20, 180, 140) $radio_1 = GUISetControl("radio", "Radio &0", 50, 40, 120, 20) $radio_2 = GUISetControl("radio", "Radio &1", 50, 60, 60, 20) $radio_3 = GUISetControl("radio", "Radio &2", 50, 80, 60, 20) $radio_4 = GUISetControl("radio", "Radio &3", 50, 100, 60, 20) $radio_5 = GUISetControl("radio", "Radio &4", 50, 120, 60, 20) ; Init our vars that we will use to keep track of GUI events $radioval1 = 0 ; We will assume 0 = first radio button selected, 2 = last button $radioval2 = 2 GuiShow() ;$msg = GuiMsg() ; In this message loop we use variables to keep track of changes to the radios, another ; way would be to use GuiRead() at the end to read in the state of each control While 1 $msg = GuiMsg(0) Select Case $msg = -5 Exit Case $msg = $button_1 ; MsgBox(0, "Default button clicked", $radioval1 ) RunAsSet("username", "domain", "password") If $radioval1 = 0 Then RunWait("\\svr\SoftDump\Authorware plugin\macro7.EXE") ElseIf $radioval1 = 1 Then RunWait("\\svr\softdump\flash player\flashplayer6_winax.exe") ElseIf $radioval1 = 2 Then RunWait("\\svr\SoftDump\WinZip\WZ90.EXE") ElseIf $radioval1 = 3 Then RunWait("\\svr\SoftDump\SmartForce\dyncli32.exe") ElseIf $radioval1 = 4 Then RunWait("\\svr\SoftDump\Append Footer\setup.exe") Else MsgBox(16, ":: Software Install ::", "You selected invalid option" & @LF & "The program will exit now") EndIf RunAsSet() WinMinimizeAllUndo() Exit Case $msg = $radio_1 OR $msg = $radio_2 OR $msg = $radio_3 OR $msg = $radio_4 OR $msg = $radio_5 $radioval1 = $msg - $radio_1 ExitLoop EndSelect WEnd ;"Radio " & ;------------------- Link to comment Share on other sites More sharing options...
pekster Posted August 16, 2004 Share Posted August 16, 2004 If the GUI is closed by the "x" button, it will return -3 by GuiMsg(0). Just add a new case block for that, and tell it to exit. [font="Optima"]"Standing in the rain, twisted and insane, we are holding onto nothing.Feeling every breath, holding no regrets, we're still looking out for something."[/font]Note: my projects are off-line until I can spend more time to make them compatable with syntax changes. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now