TwoCanoe Posted February 14 Author Posted February 14 Definately working, x86 and x64. I modified your script slightly: Removed the Example function. Saved the Script as DebugCapture.au3 (Your script is now used as a UDF) Then I slighty modified Autoitter's DebugViewer script: expandcollapse popup;=================================================================================================== ; ; Script Name : DebugViewer ; ; Script Function : Example using the DebugCapture UDF ; ; Link : https://www.autoitscript.com/forum/topic/82889-capture-debug-information-udf/ ; ; AutoIt Version : 3.2.12.1 ; Script version : 1.0 ; Date : 19-10-2008 ; Author : Steven Scholte (a.k.a. autoitter) ; ;=================================================================================================== AutoItSetOption("MustDeclareVars", 1) AutoItSetOption("TrayAutoPause", 0) #include "DebugCapture.au3" #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #include "GuiListView.au3" Global $MainForm = GUICreate("Debug Viewer", 600, 300, -1, -1) Global $ListViewDebug = GUICtrlCreateListView("Time|PID|Debug Output", 16, 17, 571, 212) GUICtrlSendMsg($ListViewDebug, 0x101E, 0, 60) GUICtrlSendMsg($ListViewDebug, 0x101E, 1, 50) GUICtrlSendMsg($ListViewDebug, 0x101E, 2, 440) Global $ButtonStart = GUICtrlCreateButton("Start", 417, 250, 75, 30, 0) Global $ButtonStop = GUICtrlCreateButton("Stop", 505, 250, 75, 30, 0) GUICtrlSetState($ButtonStop, $GUI_DISABLE) GUISetState(@SW_SHOW) ; Global variables Global $bCapturing = False Global $iIndex Global $iPid Global $strData ; Main loop While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE If $bCapturing Then StopDebugCapture() Exit Case $ButtonStart StartCapture() Case $ButtonStop StopCapture() EndSwitch If $bCapturing Then $strData = GetDebugOutput() If (Not @error) And ($strData <> "") Then $iPid = @extended $iIndex = _GUICtrlListView_AddItem($ListViewDebug, @HOUR & ":" & @MIN & ":" & @SEC) ; Add time _GUICtrlListView_AddSubItem($ListViewDebug, $iIndex, $iPid, 1) ; Add PID _GUICtrlListView_AddSubItem($ListViewDebug, $iIndex, StringStripWS($strData, 2), 2) ; Add debug information (remove trailing CR/LF) _GUICtrlListView_EnsureVisible($ListViewDebug, $iIndex) ; Scroll into view EndIf EndIf Sleep(10) ; Helps to keep CPU load low WEnd Func StartCapture() If Not $bCapturing Then StartDebugCapture() Switch @error Case 0 $bCapturing = True GUICtrlSetState($ButtonStart, $GUI_DISABLE) GUICtrlSetState($ButtonStop, $GUI_ENABLE) Case 1 MsgBox(16, @ScriptName, "Error loading DebugCapture.dll", 0, $MainForm) Case 2 MsgBox(16, @ScriptName, "Initialization failed.", 0, $MainForm) Case 3 MsgBox(64, @ScriptName, "Another debugger is already active.", 0, $MainForm) EndSwitch EndIf EndFunc Func StopCapture() If $bCapturing Then StopDebugCapture() $bCapturing = False GUICtrlSetState($ButtonStart, $GUI_ENABLE) GUICtrlSetState($ButtonStop, $GUI_DISABLE) EndIf EndFunc Give it a try Nine, may help. argumentum 1
Nine Posted February 14 Posted February 14 2 hours ago, TwoCanoe said: I modified your script slightly No problem. It was fun to make it work. Enjoy. “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 Multi-Threading Made Easy
TwoCanoe Posted February 15 Author Posted February 15 (edited) 3 hours ago, Nine said: Enjoy. Will do! Earlier, I didn't get the chance to test your script any further. Your code works with filters, that's all I need. Many thanks for your efforts Nine 🏆 Edited February 15 by TwoCanoe mmm.. spelling!
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