Export (0) Print
Expand All

WinEventProc callback function

An application-defined callback (or hook) function that the system calls in response to events generated by an accessible object. The hook function processes the event notifications as required. Clients install the hook function and request specific types of event notifications by calling SetWinEventHook.

The WINEVENTPROC type defines a pointer to this callback function. WinEventProc is a placeholder for the application-defined function name.

Syntax


void CALLBACK WinEventProc(
  HWINEVENTHOOK hWinEventHook,
  DWORD event,
  HWND hwnd,
  LONG idObject,
  LONG idChild,
  DWORD dwEventThread,
  DWORD dwmsEventTime
);

Parameters

hWinEventHook

Type: HWINEVENTHOOK

Handle to an event hook function. This value is returned by SetWinEventHook when the hook function is installed and is specific to each instance of the hook function.

event

Type: DWORD

Specifies the event that occurred. This value is one of the event constants.

hwnd

Type: HWND

Handle to the window that generates the event, or NULL if no window is associated with the event. For example, the mouse pointer is not associated with a window.

idObject

Type: LONG

Identifies the object associated with the event. This is one of the object identifiers or a custom object ID.

idChild

Type: LONG

Identifies whether the event was triggered by an object or a child element of the object. If this value is CHILDID_SELF, the event was triggered by the object; otherwise, this value is the child ID of the element that triggered the event.

dwEventThread

Type: DWORD

Identifies the thread that generated the event, or the thread that owns the current window.

dwmsEventTime

Type: DWORD

Specifies the time, in milliseconds, that the event was generated.

Return value

This callback function does not return a value.

Remarks

Within the hook function, the parameters hwnd, idObject, and idChild are used when calling AccessibleObjectFromEvent.

Servers generate events by calling NotifyWinEvent.

Create multiple callback functions to handle different events. For more information, see Registering a Hook Function.

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)

See also

SetWinEventHook

 

 

Community Additions

ADD
Show:
© 2014 Microsoft