Function Reference


_EventLog__Count

Retrieves the number of records in the event log

#include <EventLog.au3>
_EventLog__Count ( $hEventLog )

Parameters

$hEventLog A handle to the event log

Return Value

Success: the number of records in the event log.
Failure: -1

Remarks

The oldest record in an event log is not necessarily record number 1.
To determine the record number of the oldest record in an event log, use the _EventLog__Oldest()

Related

_EventLog__Full, _EventLog__Oldest

Example

#include "Extras\HelpFileInternals.au3"

#include <EventLog.au3>
#include <FontConstants.au3>
#include <GUIConstantsEx.au3>

Example()

Func Example()
    Local $hEventLog

    ; Create GUI
    GUICreate("EventLog", 600, 300)
    _MemoCreate(2, 2, 596, 294, 0)
    GUISetState(@SW_SHOW)

    $hEventLog = _EventLog__Open("", "Application")
    _MemoWrite("Log full ........: " & _EventLog__Full($hEventLog))
    _MemoWrite("Log record count : " & _EventLog__Count($hEventLog))
    _MemoWrite("Log oldest record: " & _EventLog__Oldest($hEventLog))
    _EventLog__Close($hEventLog)

    ; Loop until the user exits.
    Do
    Until GUIGetMsg() = $GUI_EVENT_CLOSE
EndFunc   ;==>Example