## Event Constants

The following table lists all the events generated by Active Accessibility server applications, in ascending numeric order. The EVENT_MIN and EVENT_MAX values represent the lowest and highest possible event values, respectively.

For more information about events, see WinEvents.

EVENT_SYSTEM_SOUND | A sound is being played. | Notes
EVENT_SYSTEM_ALERT | An alert was generated. | Notes
EVENT_SYSTEM_FOREGROUND | The foreground window is changing. | Notes
EVENT_SYSTEM_MENUSTART | An application is entering a modal menu loop. | Notes
EVENT_SYSTEM_MENUEND | An application is exiting a modal menu loop. | Notes
EVENT_SYSTEM_MENUPOPUPSTART | A pop-up menu is being displayed. | Notes
EVENT_SYSTEM_MENUPOPUPEND | A pop-up menu is being removed. | Notes
EVENT_SYSTEM_CAPTURESTART | A window received mouse capture.
EVENT_SYSTEM_CAPTUREEND | A window lost mouse capture.
EVENT_SYSTEM_MOVESIZESTART | A window entered a modal move or size loop.
EVENT_SYSTEM_MOVESIZEEND | A window exited a modal move or size loop.
EVENT_SYSTEM_CONTEXTHELPSTART | A window entered context-sensitive Help mode.
EVENT_SYSTEM_CONTEXTHELPEND | A window exited context-sensitive Help mode.
EVENT_SYSTEM_DRAGDROPSTART | An application is about to enter drag-and-drop mode. | Notes
EVENT_SYSTEM_DRAGDROPEND | An application is about to exit drag-and-drop mode. | Notes
EVENT_SYSTEM_DIALOGSTART | A dialog box was displayed. | Notes
EVENT_SYSTEM_DIALOGEND | A dialog box was removed. | Notes
EVENT_SYSTEM_SCROLLINGSTART | A scroll bar is being tracked. | Notes
EVENT_SYSTEM_SCROLLINGEND | A scroll bar is no longer being tracked. | Notes
EVENT_SYSTEM_SWITCHSTART | The user pressed ALT+TAB. | Notes
EVENT_SYSTEM_SWITCHEND | The user released ALT+TAB. | Notes
EVENT_SYSTEM_MINIMIZESTART | A window object is about to be minimized or maximized.
EVENT_SYSTEM_MINIMIZEEND | A window object was minimized or maximized.
EVENT_OBJECT_CREATE | An object was created. | Notes
EVENT_OBJECT_DESTROY | An object was destroyed. | Notes
EVENT_OBJECT_SHOW | An object is being shown. | Notes
EVENT_OBJECT_HIDE | An object is being hidden. | Notes
EVENT_OBJECT_REORDER | A container object's children are changing their z-order placements. | Notes
EVENT_OBJECT_FOCUS | An object is receiving keyboard focus. | Notes
EVENT_OBJECT_SELECTION | An object selection change occurred. | Notes
EVENT_OBJECT_SELECTIONADD | An object was added to the selection. | Notes
EVENT_OBJECT_SELECTIONREMOVE | An object was removed from the selection. | Notes
EVENT_OBJECT_SELECTIONWITHIN | Numerous selection changes occurred within a container. | Notes
EVENT_OBJECT_STATECHANGE | An object's state changed. | Notes
EVENT_OBJECT_LOCATIONCHANGE | An object is changing location, shape, or size. | Notes
EVENT_OBJECT_NAMECHANGE | An object's Name property changed.
EVENT_OBJECT_DESCRIPTIONCHANGE | An object's Description property changed.
EVENT_OBJECT_VALUECHANGE | An object's Value property changed.
EVENT_OBJECT_PARENTCHANGE | An object has a new parent object.
EVENT_OBJECT_HELPCHANGE | An object's Help property changed.
EVENT_OBJECT_DEFACTIONCHANGE | An object's DefaultAction property changed.
EVENT_OBJECT_ACCELERATORCHANGE | An object's KeyboardShortcut property changed.

### EVENT_SYSTEM_SOUND Notes

The system generates this event when a system sound (for menus, and so on) is played. The system will generate this event even if no sound is audible (for example, lack of a sound file to play, no sound card, and so on).

For this event, the WinEventProc callback function will receive the OBJID_SOUND value as the idObject parameter.

### EVENT_SYSTEM_ALERT Notes

Message boxes generate this event when they are displayed.

### EVENT_SYSTEM_FOREGROUND Notes

The system generates this event even if the foreground window is changing to another window in the same thread.

For this event, the WinEventProc callback function's hwnd parameter is the handle to the window that is now in the foreground, and the idObject parameter is OBJID_WINDOW. The idChild parameter is CHILDID_SELF.

### EVENT_SYSTEM_MENUSTART Notes

For this event, the WinEventProc callback function's hwnd, idObject, and idChild parameters refer to the control with the menu bar or the control activating the context menu.

The hwnd parameter is the handle to the top-level window related to the event. The idObject parameter will be OBJID_MENU or OBJID_SYSMENU for a menu, or OBJID_WINDOW for a pop-up menu. The idChild parameter will be CHILDID_SELF.

### EVENT_SYSTEM_MENUEND Notes

For this event, the WinEventProc callback function's hwnd, idObject, and idChild parameters refer to the control with the menu bar or the control activating the context menu.

The hwnd parameter is the handle to the top-level window related to the event. The idObject parameter will be OBJID_MENU or OBJID_SYSMENU for a menu, or OBJID_WINDOW for a pop-up menu. The idChild parameter will be CHILDID_SELF.

### EVENT_SYSTEM_MENUPOPUPSTART Notes

For this event, the WinEventProc callback function's hwnd, idObject, and idChild parameters refer to the new pop-up menu being displayed, not the parent item. You can retrieve the parent or pop-up menu by calling the IAccessible::get_accParent method.

When an application displays a pop-up menu, the client will receive an EVENT_SYSTEM_MENUSTART event followed almost immediately by this event.

### EVENT_SYSTEM_MENUPOPUPEND Notes

When a pop-up menu disappears, the client will receive this message followed almost immediately by the EVENT_SYSTEM_MENUEND event.

### EVENT_SYSTEM_DRAGDROPSTART Notes

Applications that support drag-and-drop operations must send this event; the system does not.

### EVENT_SYSTEM_DRAGDROPEND Notes

Applications that support drag-and-drop operations must send this event; the system does not.

### EVENT_SYSTEM_DIALOGSTART Notes

Applications must send this event after the dialog box is completely initialized and visible.

### EVENT_SYSTEM_DIALOGEND Notes

Applications must send this event just before the dialog box is removed from the screen.

### EVENT_SYSTEM_SCROLLINGSTART Notes

This event applies to scroll bars contained in windows and top-level scroll bar controls. Top-level scroll bar controls are identified by the OBJID_HSCROLL and OBJID_VSCROLL object ID values.

### EVENT_SYSTEM_SCROLLINGEND Notes

This event applies to scroll bars contained in windows and top-level scroll bar controls. Top-level scroll bar controls are identified by the OBJID_HSCROLL and OBJID_VSCROLL object ID values.

### EVENT_SYSTEM_SWITCHSTART Notes

For this event notification, the hwnd parameter of the WinEventProc callback function identifies the window that the user is switching to.

If only one application is running when the user presses ALT+TAB, the client application can receive an EVENT_SYSTEM_SWITCHEND event without a corresponding EVENT_SYSTEM_SWITCHSTART event.

### EVENT_SYSTEM_SWITCHEND Notes

For this event notification, the hwnd parameter of the WinEventProc callback function identifies the window that the user switched to.

If only one application is running when the user presses ALT+TAB, the client application can receive this event without a corresponding EVENT_SYSTEM_SWITCHSTART event.

### EVENT_OBJECT_CREATE Notes

In the case of window objects only, both the parent and the child send this event. The child window sends the event when created, and the parent sends it after creation is complete. Note that the child window is responsible for sending this event before the parent.

If the client is using synchronous callbacks, it should not attempt to retrieve the parent object (by using IAccessible::get_accParent) until after control is yielded to the operating system.

### EVENT_OBJECT_DESTROY Notes

In the case of window objects only, both the parent and the child send this event. The child window sends the event when it is destroyed, and the parent sends it after destruction is complete. Note that the child window is responsible for sending this event before the parent. It is assumed that all the children of an object are destroyed when the parent is destroyed. This event is also sent when an application is shutting down.

Calling IAccessible properties at this point can cause a crash—in particular, when the call references a DLL that is unloaded first. Calling the IAccessible::get_accName method is a good example. It eventually calls SysAllocString, a Win32 API call. exported by oleaut32.dll. If oleaut32.dll is unloaded first, it crashes. Therefore, upon receiving the EVENT_OBJECT_DESTROY, call these properties only for visible windows. Only invisible windows are dangerous because some of them are destroyed after a majority of the system has already been destroyed. To get the name of the invisible window, try using GetWindowText, a Win32 API call.

### EVENT_OBJECT_SHOW Notes

When a parent object is being shown, all child objects are, of course, visible on the screen. Therefore, server applications must not send this event for the child objects.

### EVENT_OBJECT_HIDE Notes

When a parent object is being hidden, all child objects are, of course, no longer visible on the screen. They still have the same "visible" status, but are not truly visible. Therefore, server applications must not send this event for the child objects.

### EVENT_OBJECT_REORDER Notes

The object referred to in the hwnd and idObject parameters of the WinEventProc callback function identify the parent container object in which z-ordering is occurring. This is because if one child changes its z-order, all of them must change.

### EVENT_OBJECT_FOCUS Notes

The parameters received in the WinEventProc callback function describe the object that is receiving the keyboard focus.

There is only one focused child item in a parent. The focused child is the object that receives keystrokes at a given moment. Hence, server applications must only send this notification describing where the new focus is going. That is, a new item that gets the focus implies that the old one is losing it.

Do not confuse object focus with object selection. For more information, see Accessible Object Selection and Focus.

### EVENT_OBJECT_SELECTION Notes

Server applications send this notification when the item being selected is within the same container as the last selected object.

The hwnd and idObject parameters of the WinEventProc callback function describe the container, and the idChild parameter identifies the object that is selected. The idChild parameter can be OBJID_WINDOW if the selected child is a window that also contains objects.

Do not confuse object selection with object focus. For more information, see Accessible Object Selection and Focus.

### EVENT_OBJECT_SELECTIONADD Notes

Server applications send this notification when an object or objects have been added to the selection within a container. This is appropriate when the number of newly selected items is very small.

The hwnd and idObject parameters of the WinEventProc callback function describe the container, and the idChild parameter is the child that was added to the selection.

Do not confuse object selection with object focus. For more information, see Accessible Object Selection and Focus.

### EVENT_OBJECT_SELECTIONREMOVE Notes

Server applications send this notification when an object or objects have been removed from the selection within a container. Like the EVENT_OBJECT_SELECTIONADD event, this is appropriate when the number of newly selected items is very small.

The hwnd and idObject parameters of the WinEventProc callback function describe the container, and the idChild parameter identifies the child that was added to the selection.

Do not confuse object selection with object focus. For more information, see Accessible Object Selection and Focus.

### EVENT_OBJECT_SELECTIONWITHIN Notes

A server application sends this notification when the selected items within a control have changed substantially. Effectively, this notification informs the client that many selection changes have occurred (instead of sending several EVENT_OBJECT_SELECTIONADD or EVENT_OBJECT_SELECTIONREMOVE events). The client can query for the selected items by calling the container object's IAccessible::get_accSelection method and enumerating the selected items.

For this event notification, the hwnd and idObject parameters of the WinEventProc callback function describe the container in which the changes occurred.

Do not confuse object selection with object focus. For more information, see Accessible Object Selection and Focus.

### EVENT_OBJECT_STATECHANGE Notes

A state change can occur when a button object has been pressed or released, when an object is being enabled or disabled, or whatever else is pertinent for a given object. USER sends these events on behalf of standard controls, like push buttons and check boxes.

For this event notification, the idChild parameter of the WinEventProc callback function identifies the child object whose state changed.

### EVENT_OBJECT_LOCATIONCHANGE Notes

This event is generated in response to the topmost level object that has changed, not for any children it might contain. For example, if the user resizes a top-level window, USER generates this notification for the window, but not for the menu bar, title bar, scroll bars, or other objects that are also changing.

USER generates this event for windows that are changing. It does not do this for every nonfloating child window when the parent moves. However, if an application explicitly resizes child windows as a result of being sized, USER will generate multiple events for the resized children. Additionally, USER generates this event for two nonwindow system objects: the system caret and the cursor.

For this event notification, the idChild parameter of the WinEventProc callback function identifies the child object that changed.

© 1997 Microsoft Corporation. All rights reserved. Legal Notices.