Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

NotifyWinEvent function

Signals the system that a predefined event occurred. If any client applications have registered a hook function for the event, the system calls the client's hook function.

Syntax


void WINAPI NotifyWinEvent(
  _In_  DWORD event,
  _In_  HWND hwnd,
  _In_  LONG idObject,
  _In_  LONG idChild
);

Parameters

event [in]

Type: DWORD

Specifies the event that occurred. This value must be one of the event constants.

hwnd [in]

Type: HWND

Handle to the window that contains the object that generated the event.

idObject [in]

Type: LONG

Identifies the object that generated the event. This value is either one of the predefined object identifiers or a custom object ID value.

idChild [in]

Type: LONG

Identifies whether the event was generated by an object or by a child element of the object. If this value is CHILDID_SELF, the event was generated by the object itself. If not CHILDID_SELF, this value is the child ID of the element that generated the event.

Return value

This function does not return a value.

Remarks

Servers call this function to notify the system that an event has occurred. Microsoft Active Accessibility checks to see if any client applications have set hook procedures for the event and, if so, calls the appropriate hook procedures.

If no hook procedures are registered for the event, the performance penalty for calling this function is minor.

Servers call NotifyWinEvent to announce the event to the system after the event has occurred; they must never notify the system of an event before the event has occurred.

When the client's hook procedure is called, it receives a number of parameters that describe the event and the object that generated the event. The hook procedure uses the AccessibleObjectFromEvent function to retrieve a pointer to the IAccessible interface of the object that generated the event.

Servers may receive a WM_GETOBJECT message immediately after calling this function. This can happen if there are any in-context clients that call AccessibleObjectFromEvent in the event callback.

When servers call this function, they must be ready to handle WM_GETOBJECT, return an IAccessible interface pointer, and handle any of the IAccessible methods.

Note to Server Developers:  When you call NotifyWinEvent, if any clients are listening for that event in-context, their event handlers, which typically send WM_GETOBJECT and call IAccessible methods, will execute before NotifyWinEvent returns. When you call NotifyWinEvent, you should be prepared to handle these calls, if they occur. If you need to do extra setup to allow for this, you should do so before you call NotifyWinEvent, not after.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Redistributable

Active Accessibility 1.3 RDK on Windows NT 4.0 with SP6 and later and Windows 95

Header

Winuser.h (include Windows.h)

Library

User32.lib

DLL

User32.dll

See also

AccessibleObjectFromEvent
SetWinEventHook
UnHookWinEvent
WinEvents

 

 

Community Additions

Show:
© 2014 Microsoft