Opens a handle to a backup event log
#include <EventLog.au3>
_EventLog__OpenBackup ( $sServerName, $sFileName )
$sServerName | The UNC name of the server on where the event log will be opened. If blank, the operation is performed on the local computer. |
$sFileName | The name of the backup file |
Success: | the handle to the backup event log. |
Failure: | 0. |
If the backup filename specifies a remote server, $sServerName must be blank.
_EventLog__Backup, _EventLog__Close
#include <EventLog.au3>
#include <FontConstants.au3>
#include <GUIConstantsEx.au3>
Global $g_idMemo
Example()
Func Example()
Local $hEventLog
; Create GUI
GUICreate("EventLog", 600, 300)
$g_idMemo = GUICtrlCreateEdit("", 2, 2, 596, 294, 0)
GUICtrlSetFont($g_idMemo, 9, $FW_NORMAL, $GUI_FONTNORMAL, "Courier New")
GUISetState(@SW_SHOW)
$hEventLog = _EventLog__Open("", "Application")
_EventLog__Backup($hEventLog, "C:\EventLog.bak")
_EventLog__Close($hEventLog)
$hEventLog = _EventLog__OpenBackup("", "C:\EventLog.bak")
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
; Write a line to the memo control
Func MemoWrite($sMessage)
GUICtrlSetData($g_idMemo, $sMessage & @CRLF, 1)
EndFunc ;==>MemoWrite