The OpenEventLog function opens a handle to an event log.
HANDLE OpenEventLog(
LPCTSTR lpUNCServerName, // pointer to server name
LPCTSTR lpSourceName // pointer to source name
);
If the function succeeds, the return value is the handle to an event log.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
Windows NT: Requires version 3.1 or later.
Windows: Unsupported.
Windows CE: Unsupported.
Header: Declared in winbase.h.
Import Library: Use advapi32.lib.
Unicode: Implemented as Unicode and ANSI versions on Windows NT.
Event Logging Overview, Event Logging Functions, ClearEventLog, CloseEventLog, GetNumberOfEventLogRecords, GetOldestEventLogRecord, ReadEventLog, ReportEvent