Sign in to follow this  
Followers 0
gcue

strange gui freeze when exiting

12 posts in this topic

#1 ·  Posted (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:

Func 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 by gcue

Share this post


Link to post
Share on other sites



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

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#3 ·  Posted (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 by gcue

Share this post


Link to post
Share on other sites

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

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#6 ·  Posted (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 by gcue

Share this post


Link to post
Share on other sites

gcue,

any ideas?

Yes. :huh2:

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._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

nevermind i found it

http://www.autoitscript.com/trac/autoit/ticket/1319

thanks again!

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

gcue,

Still an open ticket here #1319. :huh2:

M23

Edit: You beat me to it!

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#11 ·  Posted (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 :huh2:...

Edited by KaFu

Share this post


Link to post
Share on other sites

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]

Share this post


Link to post
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
Sign in to follow this  
Followers 0