dominique Posted Tuesday at 02:32 PM Posted Tuesday at 02:32 PM When using the Debug Window I discovered that it is dynamically resized and repositioned but also can become inaccessible. On one Display. Notwithstanding I resize and reposition The Debug Window using e.g. _DebugSetup($sDebugTitle) WinMove($sDebugTitle, "", -0, 0, 500, 300), when writing longer and longer records, the window is first horizontally displaced and centered on my screen and increases centered until the full width of my screen is filled with that window. The Vertical size however remains the original height. If I use two displays, let's say A and B, of equal size, both in landscape mode, with A left of B, and B being the Main display. In that case when WinMove positions the debug window on Display A, when text is written beyond the size of a single line that window jumps centered on the Main display B If further testing with still 2 Displays, but now display A in portrait mode, and display B in landscape mode, display B still the main display. If WinMove positions the window on display A at a vertical position which is not 'known' on the display B because now the height of (rotated)display A is now taller than the height of display B, writing the same byte stream as in both previous examples forces the Debug Window to jump at a non-displayed location, what results in the Debug window being Iconized on the taskbar. Trying to restore that Window from the taskbar is now impossible as there is no valid pixel coordinate on either display to show the contents of the full window on one or both displays. Question. Is it possible to have the predetermined size and position of the Debug Window frozen, meaning not dynamically adapted according to the written contents?
Nine Posted Tuesday at 03:43 PM Posted Tuesday at 03:43 PM After _DebugSetup, you can set : $__g_sReportCallBack_Debug = "My__Debug_ReportWindowWrite(" Copy the original function (Func __Debug_ReportWindowWrite) into your script and remove the WinMove. Should work (untested). “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Debug Messages Monitor UDF Screen Scraping Round Corner GUI UDF Multi-Threading Made Easy Interface Object based on Tag
argumentum Posted Tuesday at 03:47 PM Posted Tuesday at 03:47 PM ConsoleWriteOut(FileRead(@ScriptFullPath) & @CRLF) ConsoleWriteOut() Func ConsoleWriteOut($sStr = Default, $iErr = @error, $iExt = @extended) Local Static $hGUI = 0, $idEdit = 0, $iSciTE = StringInStr($CmdLineRaw, "/ErrorStdOut"), $hTimer = TimerInit() If $sStr = Null Then $hGUI = 1 If Not $iSciTE And $hGUI = 0 Then Local $iW = 800, $iH = 400 $hGUI = GUICreate(@ScriptName, $iW, $iH, -1, -1, 0x80CF0000) ; BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_TABSTOP)) GUISetFont(10, 400, 0, "Courier New") GUISetIcon(StringTrimRight(@ScriptFullPath, 4) & ".ico") $idEdit = GUICtrlCreateEdit("", 1, 1, $iW - 1, $iH - 1) GUICtrlSetResizing(-1, 0x0066) ; $GUI_DOCKLEFT+$GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKBOTTOM) GUISetState() GUICtrlSetData($idEdit, @CRLF) EndIf Local $iRet = "" If $sStr == Default And IsHWnd($hGUI) Then GUICtrlSetData($idEdit, @CRLF & "== DONE == ( " & Round(TimerDiff($hTimer), 4) & " ms. )", 1) Do Until GUIGetMsg() = -3 GUIDelete($hGUI) Exit Else If $sStr <> Default And $iSciTE Then $iRet = ConsoleWrite($sStr) If $idEdit Then GUICtrlSetData($idEdit, $sStr, 1) EndIf Return SetError($iErr, $iExt, $iRet) EndFunc ;==>ConsoleWriteOut I use the script above to have a "Console out / debug" that echo to console while in SciTE, but popup a window if not in SciTE ( click-click in explorer ). I never used the included function so I can not help with that, but that is not the only way to do it and "my custom debug" does what I need. And this is a random "debug code" I use because at times I come up with different ideas. If you need a solution that does one thing or another, just write it one. Follow the link to my code contribution ( and other things too ). FAQ - Please Read Before Posting.
DorianAshfield Posted Thursday at 01:51 PM Posted Thursday at 01:51 PM Thanks for the script. I will check it.
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