Jump to content

Recommended Posts

Posted (edited)

Just an example of a simple crash detector:

Only disadvantage is that you must call CleanUp() every time before you use Exit.

#include <GUIConstants.au3>

Opt('TrayIconHide', True)

$AppCrash = IniRead('CrashData.ini', 'CrashData', 'appcrash', 'Unknown')

If $AppCrash = 'true' Then
    MsgBox(-1, 'Info', 'The script crashed last time it was used')
EndIf

IniWrite('CrashData.ini', 'CrashData', 'AppCrash', 'true')

GUICreate('Crash Detector', 250, 40)

$CrashSim = GUICtrlCreateButton('Simulate Crash', 5, 5, 115, 30)
$Exit = GUICtrlCreateButton('Exit', 130, 5, 115, 30)

GUISetState()

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            CleanUp()
        Case $Exit
            CleanUp()
        Case $CrashSim
            Exit
    EndSwitch
WEnd

Func CleanUp()
    GUIDelete()
    IniWrite('CrashData.ini', 'CrashData', 'AppCrash', 'false')
    Exit
EndFunc
Edited by Vadersapien
Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor.
Posted

It will not show any data about the crash, after the script crashed nothing will be writen to your ini-file.

 

  Reveal hidden contents

 

 

AutoIt is simple, subtle, elegant. © AutoIt Team

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...