Patchworks Posted August 17, 2011 Share Posted August 17, 2011 I've been using the DebugSetup for log screens but everytime the script is done it leaves the script still running even though i do an exit. How do you make the script close using the Debug Screens? Thanks, p Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted August 17, 2011 Moderators Share Posted August 17, 2011 Patchworks,From looking at the code of Debug.au3, the script remain active until the report window is closed, So as you know the title of the Debug window, just close it when you exit: #include <Debug.au3> $sTitle = "My Debug Report" _DebugSetup($sTitle) For $i = 1 To 9 _DebugOut("Debug " & $i) Sleep(1000) Next MsgBox(0, "Ready to Exit?", "Press OK when ready to Exit") WinClose($sTitle)I believe you will have to do something like this for every exit option in your script - using OnAutoItExitRegister to close the GUI will not work as the Debug part of the script is still active until you close the Debug GUI = Catch 22. 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...
ferrix Posted December 19, 2013 Share Posted December 19, 2013 (edited) For what it's worth, the WinClose approach did not work for me. I had better luck with: GUIDelete( WinGetHandle( $sTitle) ) Where sTitle is defined as in the Melba23 post. Edited December 19, 2013 by ferrix Link to comment Share on other sites More sharing options...
therealhanuta Posted April 10, 2014 Share Posted April 10, 2014 I believe you will have to do something like this for every exit option in your script - using OnAutoItExitRegister to close the GUI will not work as the Debug part of the script is still active until you close the Debug GUI = Catch 22. Hi Melba23, I have found a solution. It is not best, because it use AdlibRegister. But it works fine. #include <Debug.au3> _DebugSetup() AdlibRegister("Debug_ReportWindowWaitClose") For $i = 1 To 100 _DebugReport($i) Sleep(100) Next Func Debug_ReportWindowWaitClose() If Not $__gbReportWindowWaitClose_Debug Then Return 0 ; use of the already opened window so no need to wait Local $nOld = Opt("WinDetectHiddenText", True) Local $hWndReportWindow = WinGetHandle($__gsReportTitle_Debug, $__gsReportWindowText_Debug) Opt("WinDetectHiddenText", $nOld) $nOld = Opt('GUIOnEventMode', 0) ; save event mode in case user script was using event mode Local Const $GUI_EVENT_CLOSE = -3 Local $aMsg While WinExists(HWnd($hWndReportWindow)) $aMsg = GUIGetMsg(1) If Not $aMsg[0] Then ExitLoop If $aMsg[1] = $hWndReportWindow And $aMsg[0] = $GUI_EVENT_CLOSE Then GUIDelete($hWndReportWindow) Exit EndIf WEnd Opt('GUIOnEventMode', $nOld) ; restore event mode EndFunc 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