Jump to content
Sign in to follow this  

_DebugOut - Close or Kill Report Log Window

Recommended Posts

Hey Folks,

I have an autoit script that runs (monitors) a local system for a specific process. When the process is detected it completes an action but does not close. The script runs all the time and works great.

To assist field techs with troubleshooting I wanted to use _DebugSetup() to open the Report Log Window and display _debugOut lines within my code to indicate what is going on with the script while it is running. I have created a taskmenuitem that can be checked off to initiate the Debug output. This also works great. I would like to be able to deselect the menu item and have the debug stop or at a minimum have the Report Log Window close. I know that it will stop debuging if I kill the script, but I wish for the script to remain running.

Here is an example of what I want to accomplish:

#include <constants.au3>
#include <debug.au3>
Opt("TrayMenuMode", 1)

$DebugMenuItem = TrayCreateItem("Debug")

While 1
    _DebugOut("No Process detected... Looping")
    While ProcessExists("notepad.exe")
        _DebugOut("Process detected Perform action...")
        MsgBox(0,'','Perform Action')

Func _CheckTrayItem()
    $Checkbox = TrayItemGetState($DebugMenuItem)
    IF $Checkbox = '65' Then
        MsgBox(0,'','This is where I want to Kill the Debug')
Func _Debug()
    _DebugSetup("DEBUGLOG - " & @ScriptName)
    _DebugOut('User: ' & @UserName  & ' Computer: ' & @ComputerName & ' Date: ' & @MON & "/" & @MDAY & "/" & @YEAR & " - " & @HOUR & ":" & @MIN & ":" & @SEC)
    _DebugOut('******************SCRIPT START************************')

Share this post

Link to post
Share on other sites

FIXED: Before I posted I should have just opened up the include. I used the internal function __Debug_ReportClose() for debug.au3 to close the window and stop the debug.

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  

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...