Terenz Posted May 23, 2015 Share Posted May 23, 2015 (edited) I'm using multiple GUI with one loop, simultaneously using the "advanced" parameter with GUIGetMsg, following the tutorial Managing Multiple GUIsI have a doubt, it declare the second GUI and his button with 9999 using this reason:Predeclare the variables with dummy values to prevent firing the Case statementsNow my question is, if i'm deleting that GUI with GUIDelete i need to redeclare all that variable with 9999 again for "prevent firing the Case statements"?I hope is not but i'm wainting for a definite answer. Thanks Edited May 23, 2015 by Terenz spelling, my wrost enemy Nothing is so strong as gentleness. Nothing is so gentle as real strength Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 23, 2015 Moderators Share Posted May 23, 2015 Terenz,No, you do not need to reset the variable to 9999.You need something in the variable or else the Case fires off all the time as an empty variable is interpreted as 0 by AutoIt and it matches the "no event" return from GUIGetMsg. Once the variable has been filled with an actual handle, it will look for that value even if the GUI has been deleted - and normally Windows allocates unique handles so it will never be found again until you create a new GUI and replace it. But just in case Windows were to reuse the same handle, good coding practice says you might wish to reset the variable to 9999 when you delete the GUI.All clear?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 Link to comment Share on other sites More sharing options...
Terenz Posted May 23, 2015 Author Share Posted May 23, 2015 (edited) So do you mean, just in case, i need to declare only $hGUI2 to 9999 if i'm deleting it and not all of his control, right? Because re-declare one variable is OK and not a problem, re-declare 250 isn't the best way to use my time Edited May 23, 2015 by Terenz Nothing is so strong as gentleness. Nothing is so gentle as real strength Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 23, 2015 Moderators Share Posted May 23, 2015 Terenz,As the example in the Wiki shows, you do not have to reset the ControlIDs of any deleted controls as the Switch structure will never enter the section where it tests them because their GUI no longer exists. And this despite the fact that, unlike Windows handles, AutoIt ControlIDs are reused.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 Link to comment Share on other sites More sharing options...
Terenz Posted May 23, 2015 Author Share Posted May 23, 2015 (edited) Melba so why the tutorial has:Global $hGUI2 = 9999, $hButton3 = 9999Instead of:Global $hGUI2 = 9999, $hButton3If the button will never fired because of the Switch structure, why declare the control with a dummy value? Isn't that unnecessary?Another thing, i'd like to have a function for deleting the GUI and re-assing the variable to 9999 but seems in this way not work:Global $hGUI = "0x123456"_GUIDelete($hGUI)MsgBox(0,0,$hGUI)Func _GUIDelete($var) GUIDelete($var) $var = 9999EndFuncWhat approach i can use?P.S. Don't ask me why but on Chrome i have lost the CODE button, i see only "B" "I" "U" "LINK" "QUOTE" "EMOTICON" Edited May 23, 2015 by Terenz Nothing is so strong as gentleness. Nothing is so gentle as real strength Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 23, 2015 Moderators Share Posted May 23, 2015 Terenz,Probably because I copied that line from the earlier scripts in the tutorial - nobody is perfect.In your code snippet you have passed the "handle" by value and so any changes made to it in the function are not reflected outside. if you were to pass the "handle" by reference then you would get the required result:Global $hGUI = 0x123456 _GUIDelete($hGUI) MsgBox(0,0,$hGUI) Func _GUIDelete(ByRef $var) GUIDelete($var) $var = 9999 EndFuncThe Variables - using Global, Local, Static and ByRef tutorial in the Wiki explains ByRef in more detailM23 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 Link to comment Share on other sites More sharing options...
Terenz Posted May 23, 2015 Author Share Posted May 23, 2015 Thanks. What about the CODE button? I rembember the last time i have see it on the new layout Nothing is so strong as gentleness. Nothing is so gentle as real strength Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 23, 2015 Moderators Share Posted May 23, 2015 Terenz,There seem to be an number of problems with the new editor. Try clearing your cache and restarting the browser.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 Link to comment Share on other sites More sharing options...
Terenz Posted May 23, 2015 Author Share Posted May 23, 2015 On Chrome nothing change, from IE on another PC i see many buttons include "Add Code", "Spoiler", "Font" things i don't see on Chrome see my screenshot above...the previus layout was also compatible with my phone and i was able to post, this not. Well, i prefer the other one. Nothing is so strong as gentleness. Nothing is so gentle as real strength 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