The ClearEventLog function clears the specified event log, and optionally saves the current copy of the logfile to a backup file.
Declare Function ClearEventLog Lib "advapi32.dll" Alias "ClearEventLogA" (ByVal hEventLog As Long, ByVal lpBackupFileName As String) As Long
|Operating Systems Supported|
|Requires Windows NT 3.1 or later; Win9x/ME: Not supported|
[in] Handle to the event log to be cleared. This handle is returned by the OpenEventLog function.
[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.
|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.