Share via


IsWinEventHookInstalled

The IsWinEventHookInstalled function determines if there is a WinEvent hook installed that might be notified of a specified event.

BOOL WINAPI IsWinEventHookInstalled(
DWORDevent);

Parameters

  • event
    [in] The event constant that hooks might be notified of. The function checks to see if there is a hook for this event constant.

Return Values

If there is a hook to be notified of the specified event, the return value is TRUE.

If there are no hooks to be notified of the specified event, the return value is FALSE.

Remarks

This API is guaranteed to never return a FALSE-NEGATIVE. If this API returns FALSE, it means that there are no hooks in the system that would be notified of the event. However, this API may return a FALSE-POSITIVE. In other words, it may return TRUE even though there are no hooks that would be notified. Thus it is safe for components to circumvent some work if this API returns FALSE.

Event hooks can be installed at any time, so server developers should not cache the return value for long periods of time.

Requirements

**  Windows NT/2000/XP/Server 2003:** Included in Windows XP and Windows Server 2003.
**  Windows 95/98/Me:** Unsupported.
**  Redistributable:** Requires Active Accessibility 2.0 RDK on Windows NT 4.0 SP6 and Windows 98.
**  Header:** Declared in Winuser.h.
**  Library:** Use User32.lib.

See Also

SetWinEventHook, UnhookWinEvent