I am using the Debug window to see feedback during testing of my compilations, but what is really annoying is even when I close the compilation program, the debug window stays open.
I guess I could just kill it by using the red X icon in the IDE, but that doesn't feel "proper".. Is it possible to close the debug window with an Event?
Would be nice if this was taken care of as part of PB's cleanup routine, when an application ends.
Can we programmatically close the Debug Window?
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: Can we programmatically close the Debug Window?
Nooooo! It is valuable to be able to study the debug output - should be the Developer that decides when to close the Window, not PB.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- Addict
- Posts: 1675
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Re: Can we programmatically close the Debug Window?
While I do value your opinion, that doesn't answer my question!
Is there any way I can tell PB to close the Window when my program exits? It is of no use to me when the program is not running, and is just an added annoyance to have to close it manually after every test run
Is there any way I can tell PB to close the Window when my program exits? It is of no use to me when the program is not running, and is just an added annoyance to have to close it manually after every test run

Re: Can we programmatically close the Debug Window?
+1
I would use this if I could automate it via a Tool.
I am staring at dozens of open debug and variable viewer windows.
I would use this if I could automate it via a Tool.
I am staring at dozens of open debug and variable viewer windows.

The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
Re: Can we programmatically close the Debug Window?
Just put something like below that you can launch via the toolbar.
Code: Select all
Define txt$
Restore WindowNames
Repeat
Read.s txt$
txt$ + " -"
If txt$ = " -": Break: EndIf
If AW_WinExists(txt$)
AW_WinMove(txt$, $1FFFF, $1FFFF) ; Try to avoid any animation
AW_WinClose(txt$)
EndIf
ForEver
DataSection
WindowNames:
Data.s "Asm Debugger", "Data Breakpoints", "Debug Output", "Library Viewer", "Memory Viewer"
Data.s "Procedure Callstack", "Profiler Settings", "Profiler", "Purifier Settings"
Data.s "Variable Viewer", "Watch List", ""
EndDataSection
The best preparation for tomorrow is doing your best today.
- netmaestro
- PureBasic Bullfrog
- Posts: 8451
- Joined: Wed Jul 06, 2005 5:42 am
- Location: Fort Nelson, BC, Canada
Re: Can we programmatically close the Debug Window?
Code: Select all
Procedure DebugKiller(hwnd, lparam)
wt$ = Space(256)
GetWindowText_(hwnd, @wt$, 255)
If FindString(wt$, "Debug Output -")
SendMessage_(hwnd, #WM_CLOSE, 0,0)
ProcedureReturn 0
Else
ProcedureReturn 1
EndIf
EndProcedure
Procedure KillDebugWindow()
EnumWindows_(@DebugKiller(),0)
EndProcedure
Debug "We'll wait a second..."
Delay(1000)
KillDebugWindow()
BERESHEIT
Re: Can we programmatically close the Debug Window?
Very nice KJ67(and ts-soft's AutoWin) and netmaestro!
Adding this to my Tool code
Adding this to my Tool code

The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
-
- Addict
- Posts: 1675
- Joined: Sun Dec 12, 2010 12:36 am
- Location: Somewhere in the midwest
- Contact:
Re: Can we programmatically close the Debug Window?
Netmaestro,
Thanks so much for your code. It is small, clean and concise. It now has a home in my first *.pbi file, in my brand new "Helpful Utility Includes" directory.
Thanks so much for your code. It is small, clean and concise. It now has a home in my first *.pbi file, in my brand new "Helpful Utility Includes" directory.