dontask Posted February 9, 2010 Posted February 9, 2010 I have a gui box pop up asking the user to pick a backup to restore out of a list of dirs in a folder. Everything works but the gui window stays up after selecting the backup and clicking the button. What command is used to close the window and continue with the rest of the script after the $button1 is pressed? Thanks for any help. ;restore $drv = InputBox("Drive letter","What drive do you want to restore from:", "e:\" ) $array=_FileListToArray($drv & "\backup") $hwnd = GUICreate("restore", 301, 101, 192, 125) $combo = GUICtrlCreateCombo("Select a backup to restore", 66, 20, 169, 25) $Button1 = GUICtrlCreateButton("OK", 114, 56, 73, 25, $WS_GROUP) For $i=1 To Ubound($array)-1 GUICtrlSetData($combo,$array[$i]) Next GUISetState() GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $str = GUICtrlRead ( $combo ) ;end restore menu -----------------------
nitekram Posted February 9, 2010 Posted February 9, 2010 (edited) Try using the command GUISetState(@SW_HIDE, $hGUI)after the button is pressed - you will need to unhide it once you need the window again also if it is in its own while/wend loop you will have to exitloop Edited February 9, 2010 by nitekram 2¢ All by me:"Sometimes you have to go back to where you started, to get to where you want to go." "Everybody catches up with everyone, eventually" "As you teach others, you are really teaching yourself." From my dad "Do not worry about yesterday, as the only thing that you can control is tomorrow." WIKI | Tabs; | Arrays; | Strings | Wiki Arrays | How to ask a Question | Forum Search | FAQ | Tutorials | Original FAQ | ONLINE HELP | UDF's Wiki | AutoIt PDF AutoIt Snippets | Multple Guis | Interrupting a running function | Another Send StringRegExp | StringRegExp Help | RegEXTester | REG TUTOR | Reg TUTOT 2 AutoItSetOption | Macros | AutoIt Snippets | Wrapper | Autoit Docs SCITE | SciteJump | BB | MyTopics | Programming | UDFs | AutoIt 123 | UDFs Form | UDF Learning to script | Tutorials | Documentation | IE.AU3 | Games? | FreeSoftware | Path_Online | Core Language Programming Tips Excel Changes ControlHover.UDF GDI_Plus Draw_On_Screen GDI Basics GDI_More_Basics GDI Rotate GDI Graph GDI CheckExistingItems GDI Trajectory Replace $ghGDIPDll with $__g_hGDIPDll DLL 101? Array via Object GDI Swimlane GDI Plus French 101 Site GDI Examples UEZ GDI Basic Clock GDI Detection Ternary operator
Moderators Melba23 Posted February 9, 2010 Moderators Posted February 9, 2010 dontask,With a handle like that - I am surprised you did! Try GUIDelete - sounds like it might be what you are looking for.Did you skim through the Help file at all? It is one of the "Related" commands on the GUICreate page. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
dontask Posted February 9, 2010 Author Posted February 9, 2010 (edited) thanks Ill give that try... Yeah I dug through it for about an hour trying to figure it out Edited February 9, 2010 by dontask
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