gcue Posted June 15, 2011 Share Posted June 15, 2011 (edited) hello all. i have a parent gui that opens a secondary gui. if i close out of the secondary gui first then close out of the primary gui, it exits fine. however, when i exit the primary gui without exiting the secondary gui, the secondary gui exits but the primary gui freezes and never exits.. primary gui exit function: Func _Exit() Exit EndFunc secondary gui and exit: expandcollapse popupFunc Migrator_GUI() $migrator_child = GUICreate("Migrator", 525, 695) $helpmenu = GUICtrlCreateMenu("&Help") $helpitem = GUICtrlCreateMenuItem("About", $helpmenu) GUICtrlSetOnEvent(-1, "Migrator_About") $toggle_all_checkboxes = GUICtrlCreateCheckbox("(De)Select All Items", 10, 5, 130, 20) GUICtrlSetOnEvent(-1, "Migrator_ToggleCheckboxes") $migrate_printers_checkbox = GUICtrlCreateCheckbox("Migrate Printers", 415, 5, 100, 20) $source_type_combo = GUICtrlCreateCombo("", 10, 46, 95, 20, $CBS_DROPDOWNLIST) GUICtrlSetOnEvent(-1, "Migrator_ToggleSourceType") GUICtrlSetData(-1, "Source PC:|Source Folder:", "Source PC:") $source_pc_input = GUICtrlCreateInput("", 10, 70, 170, 20, BitOR($ES_UPPERCASE, $ES_AUTOHSCROLL)) $source_browse_btn = GUICtrlCreateButton("Browse", 185, 70, 50, 20) GUICtrlSetOnEvent(-1, "Migrator_SourceFolderBrowse") GUICtrlSetState(-1, $GUI_DISABLE) GUICtrlCreateLabel("->", 245, 70, 20, 20) GUICtrlSetFont(-1, 12, 600) $target_type_combo = GUICtrlCreateCombo("", 280, 46, 95, 20, $CBS_DROPDOWNLIST) SetOnEvent(-1, "Migrator_ToggleTargetType", 1, $ParamByVal, $wipe_input) GUICtrlSetData(-1, "Target PC:|Target Folder:", "Target PC:") $target_pc_input = GUICtrlCreateInput("", 280, 70, 170, 20, BitOR($ES_UPPERCASE, $ES_AUTOHSCROLL)) $target_browse_btn = GUICtrlCreateButton("Browse", 455, 70, 50, 20) GUICtrlSetOnEvent(-1, "Migrator_TargetFolderBrowse") GUICtrlSetState(-1, $GUI_DISABLE) $top_seperator = GUICtrlCreateLabel("", 10, 100, 220, 2, $SS_SUNKEN) GUICtrlCreateLabel("Source PC Initials:", 10, 110, 375, 20) $source_initials_input = GUICtrlCreateInput("", 10, 130, 60, 20, BitOR($ES_UPPERCASE, $ES_AUTOHSCROLL)) GUICtrlCreateLabel("->", 80, 130, 20, 20) GUICtrlSetOnEvent(-1, "Migrator_CopyInitials") GUICtrlSetFont(-1, 12, 600) GUICtrlCreateLabel("Target PC Initials:", 110, 110, 375, 20) $target_initials_input = GUICtrlCreateInput("", 110, 130, 60, 20, BitOR($ES_UPPERCASE, $ES_AUTOHSCROLL)) $calculate_btn = GUICtrlCreateButton("Calculate Source Sizes", 390, 130, 120, 20) SetOnEvent(-1, "Migrator_First", 1, $ParamByVal, "Migrator_CheckSourceSize") $pc_migrator_child2 = GUICreate("Sources", 505, 80, 5, 160, $WS_CHILD, Default, $pc_migrator_child) PCMigrator_BuildCheckboxes() GUISetState() GUICtrlSetResizing($migrator_child2, $GUI_DOCKALL) GUISwitch($migrator_child) GUIRegisterMsg($WM_VSCROLL, "WM_VSCROLL") GUICtrlCreateLabel("Custom Paths:", 10, 250, 100, 20) GUICtrlSetFont(-1, 9, 600) $ADD_btn = GUICtrlCreateButton("", 473, 250, 17, 17, $BS_ICON) GUICtrlSetImage(-1, "dashboard.dll", 11) GUICtrlSetOnEvent(-1, "AddCustomPath_GUI") GUICtrlSetTip(-1, "Add A File Path") $REMOVE_btn = GUICtrlCreateButton("", 493, 250, 17, 17, $BS_ICON) GUICtrlSetImage(-1, "dashboard.dll", 12) GUICtrlSetOnEvent(-1, "RemoveCustomPath") GUICtrlSetTip(-1, "Remove A File Path") $iExWindowStyle = BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES, $WS_EX_DLGMODALFRAME, $WS_EX_CLIENTEDGE) $custom_paths_view = GUICtrlCreateListView("NAME|PATH|SIZE", 10, 270, 500, 99, -1, $iExWindowStyle) _GUICtrlListView_SetColumnWidth($custom_paths_view, 0, 90) _GUICtrlListView_SetColumnWidth($custom_paths_view, 1, 330) _GUICtrlListView_SetColumnWidth($custom_paths_view, 2, 68) $edit_btn = GUICtrlCreateButton("Edit", 10, 370, 50, 20) GUICtrlSetOnEvent(-1, "Migrator_Edit") $import_btn = GUICtrlCreateButton("Import", 60, 370, 50, 20) GUICtrlSetOnEvent(-1, "Migrator_Import") $export_btn = GUICtrlCreateButton("Export", 110, 370, 50, 20) GUICtrlSetOnEvent(-1, "Migrator_Export") $total_size_label = GUICtrlCreateLabel("Total size:", 405, 370, 110, 20) GUICtrlCreateLabel("Status:", 10, 400, 60, 20) GUICtrlSetFont(-1, 9, 600) $pcmigrator_status_edit = _GUICtrlRichEdit_Create($migrator_child, "", 10, 420, 500, 115, BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL, $ES_AUTOVSCROLL)) _GUICtrlRichEdit_SetLimitOnText($migrator_status_edit, 99999999) _GUICtrlRichEdit_SetFont($migrator_status_edit, 9, "Courier New") $save_status_button = GUICtrlCreateButton("Save Status", 432, 538, 80, 20) GUICtrlSetOnEvent(-1, "Migrator_SaveStatus") GUICtrlSetState(-1, $GUI_DISABLE) ;~ $verify_copy_checkbox = GUICtrlCreateCheckbox("Verify Files After Copy", 10, 505, 120, 15) ;~ $bottom_seperator = GUICtrlCreateLabel("", 10, 525, 220, 2, $SS_SUNKEN) $create_list_checkbox = GUICtrlCreateCheckbox("Create List Of:", 10, 555, 120, 15) GUICtrlSetOnEvent(-1, "Migrator_ToggleSoftwareList") $compare_software_radio = GUICtrlCreateRadio("Software Installed On Source PC But NOT On Target PC", 10, 575, 290, 15) GUICtrlSetState(-1, $GUI_DISABLE) $all_software_radio = GUICtrlCreateRadio("All Software On Source PC", 310, 575, 160, 15) GUICtrlSetState(-1, $GUI_DISABLE) $software_list_input = GUICtrlCreateInput("", 10, 595, 447, 20) GUICtrlSetState(-1, $GUI_DISABLE) $software_list_browse = GUICtrlCreateButton("Browse", 462, 595, 50, 20) GUICtrlSetOnEvent(-1, "Migrator_SoftwareListBrowse") GUICtrlSetState(-1, $GUI_DISABLE) $COPY_BTN = GUICtrlCreateButton("Copy", 220, 625, 80, 20) SetOnEvent(-1, "Migrator_First", 1, $ParamByVal, "PCMigrator_Copy2Target") $silent_copy_checkbox = GUICtrlCreateCheckbox("Silent Copy", 225, 650, 80, 15) GUICtrlSetTip(-1, "Uncheck to disable progress window pop-ups. Each copy progress will be un-cancelable.") GUISetOnEvent($GUI_EVENT_CLOSE, "DEL_migrator_child") GUISetState() _GUIScrollBars_Init($migrator_child2) _GUIScrollBars_ShowScrollBar($migrator_child2, $SB_HORZ, False) _GUIScrollBars_SetScrollInfoMax($migrator_child2, $SB_VERT, 4) PCMigrator_PopulateCustomPaths() EndFunc ;==>Migrator_GUI Func DEL_migrator_child() GUIDelete($migrator_child) EndFunc ;==>DEL_migrator_child Edited June 15, 2011 by gcue Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 15, 2011 Moderators Share Posted June 15, 2011 gcue,It is impossible to debug the realtionship between the exit behaviour of the 2 GUIs when all you have given us to work on is 2 snippets. Please write a short working reproducer script with just the 2 GUIs and their exit code - then we can see what is going on and offer some sensible advice. Or you could look at the Managing Multiple GUIs tutorial in the Wiki and see if that helps you solve it yoruself first. 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...
gcue Posted June 15, 2011 Author Share Posted June 15, 2011 (edited) sorry about that - i'll try to piece in more items... was hoping something in the secondary gui code would have shown the reason kinda hard to pick out from 27,935 lines =) Edited June 15, 2011 by gcue Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 15, 2011 Moderators Share Posted June 15, 2011 gcue,All you should need to provide is the GUICreate/GUISetState lines and the exit code lines for the 2 GUIs - or else your problem comes from elsewhere in those many lines. 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...
gcue Posted June 15, 2011 Author Share Posted June 15, 2011 hmm even the primary GUI is 300 lines to create. hah! strange thing is that i open other GUIs within the primary gui, it exits normally.. let me look closer to see if theres any conflicting calls between both scripts Link to comment Share on other sites More sharing options...
gcue Posted June 15, 2011 Author Share Posted June 15, 2011 (edited) looks like its this section below. once i remd that out the guis exit normally. i thought it was maybe the text limit so i reduced it to 99999 but i still have the problem... i also removed the last two lines - same issue... $migrator_status_edit = _GUICtrlRichEdit_Create($migrator_child, "", 10, 420, 500, 115, BitOR($ES_MULTILINE, $WS_HSCROLL, $WS_VSCROLL, $ES_AUTOVSCROLL)) _GUICtrlRichEdit_SetLimitOnText($migrator_status_edit, 99999) _GUICtrlRichEdit_SetFont($migrator_status_edit, 9, "Courier New") this happens before anything happens to that edit control.. i can duplicate the same behavior each time open primary gui open secondary gui (that has the richedit control) close primary gui secondary gui closes and primary gui hangs any ideas? Edited June 15, 2011 by gcue Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 15, 2011 Moderators Share Posted June 15, 2011 gcue,any ideas?Yes. I seem to remember a bug report somewhere which mentioned that you need to destroy RichEdit controls with _GUICtrlRichEdit_Destroy before exiting the script or the script crashes. Try to add that to your script and see if it helps. 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...
gcue Posted June 15, 2011 Author Share Posted June 15, 2011 that worked! hmm hopefully they fix that bug soon.. have you heard if theres a fix out? or soon to be out? many thanks melba! Link to comment Share on other sites More sharing options...
gcue Posted June 15, 2011 Author Share Posted June 15, 2011 nevermind i found it http://www.autoitscript.com/trac/autoit/ticket/1319 thanks again! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted June 15, 2011 Moderators Share Posted June 15, 2011 (edited) gcue, Still an open ticket here #1319. M23 Edit: You beat me to it! Edited June 15, 2011 by Melba23 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...
KaFu Posted June 15, 2011 Share Posted June 15, 2011 (edited) When a Gui freezes on exit I always first look for resources I did not properly release (gdi+ objects, imagelists...). Edit: Upsa, that happens when you start a reply, leave the computer for a while and then you submit it anyhow ... Edited June 15, 2011 by KaFu OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
Syed23 Posted June 15, 2011 Share Posted June 15, 2011 Hi, when i created a tool with 2 gui together i use to face the same kind of issue..(like my whole desktop got frozen). i used the below function on my Exit function which resolved my issue... I am not sure but this may trigger you guys some idea! WinActivate("", "") Thank you,Regards,[font="Garamond"][size="4"]K.Syed Ibrahim.[/size][/font] 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