A | B | C |  D | E | F |  G | H | I |  J | K | L |  M | N | O |  P | Q | R |  S | T | U |  V | W | X |  Y | Z



ClearEventLog

The ClearEventLog function clears the specified event log, and optionally saves the current copy of the logfile to a backup file.

VB4-32,5,6
Declare Function ClearEventLog Lib "advapi32.dll" Alias "ClearEventLogA" (ByVal hEventLog As Long, ByVal lpBackupFileName As String) As Long

VB.NET
System.Diagnostics.EventLog.Clear

Operating Systems Supported
Requires Windows NT 3.1 or later; Win9x/ME: Not supported

Library
Advapi32

Parameter Information
- hEventLog
[in] Handle to the event log to be cleared. This handle is returned by the OpenEventLog function.

- lpBackupFileName
[in] Pointer to the null-terminated string specifying the name of a file in which a current copy of the event logfile will be placed. If this file already exists, the function fails.
If the lpBackupFileName parameter is NULL, the current event logfile is not backed up.

Return Values
If the function succeeds, the return value is nonzero. The specified event log has been backed up (if lpBackupFileName is not NULL) and then cleared.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Last update: 07 April 2006