1 out of 1 rated this helpful Rate this topic

NotifyChangeEventLog function

Enables an application to receive notification when an event is written to the specified event log. When the event is written to the log, the specified event object is set to the signaled state.

Syntax

BOOL NotifyChangeEventLog(
  __in  HANDLE hEventLog,
  __in  HANDLE hEvent
);

Parameters

hEventLog [in]

A handle to an event log. The OpenEventLog function returns this handle.

hEvent [in]

A handle to a manual-reset or auto-reset event object. Use the CreateEvent function to create the event object.

Return value

If the function succeeds, the return value is nonzero.

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

Remarks

The NotifyChangeEventLog function does not work with remote handles. If the hEventLog parameter is the handle to an event log on a remote computer, NotifyChangeEventLog returns zero, and GetLastError returns ERROR_INVALID_HANDLE.

If the thread is not waiting on the event when the system calls PulseEvent, the thread will not receive the notification. Therefore, you should create a separate thread to wait for notifications.

The system will continue to notify you of changes until you close the handle to the event log. To close the event log, use the CloseEventLog or DeregisterEventSource function.

Examples

For an example, see Receiving Event Notification.

Requirements

Minimum supported client

Windows 2000 Professional

Minimum supported server

Windows 2000 Server

Header

Winbase.h (include Windows.h)

Library

Advapi32.lib

DLL

Advapi32.dll

See also

Event Logging Functions
CloseEventLog
CreateEvent
DeregisterEventSource
OpenEventLog

 

 

Send comments about this topic to Microsoft

Build date: 9/7/2011

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ