public enum WinEvents : uint
Minimum possible value for the WinEvents
EVENT_OBJECT_CLOAKED / UNCLOAKED Sent when a window is cloaked or uncloaked. A cloaked window still exists, but is invisible to the user.
EVENT_OBJECT_CONTENTSCROLLED Sent when ending the scrolling of a window object. Unlike the similar event (EVENT_SYSTEM_SCROLLEND), this event will be associated with the scrolling window itself. There is no difference between horizontal or vertical scrolling. This event should be posted whenever scroll action is completed, including when it is scrolled by scroll bars, mouse wheel, or keyboard navigations. example: hwnd == window that is scrolling idObject == OBJID_CLIENT idChild == CHILDID_SELF
Object events The system AND apps generate these. The system generates these for real windows. Apps generate these for objects within their window which act like a separate control, e.g. an item in a list view. When the system generate them, dwParam2 is always WMOBJID_SELF. When apps generate them, apps put the has-meaning-to-the-app-only ID value in dwParam2. For all events, if you want detailed accessibility information, callers should
Drag / Drop Events These events are used in conjunction with the UI Automation Drag/Drop patterns. For DRAGSTART, DRAGCANCEL, and DRAGCOMPLETE, HWND+objectID+childID refers to the object being dragged. For DRAGENTER, DRAGLEAVE, and DRAGDROPPED, HWND+objectID+childID refers to the target of the drop that is being hovered over.
EVENT_OBJECT_HOSTEDOBJECTSINVALIDATED Sent when a window that is hosting other Accessible objects changes the hosted objects. A client may wish to requery to see what the new hosted objects are, especially if it has been monitoring events from this window. A hosted object is one with a different Accessibility framework (MSAA or UI Automation) from its host. Changes in hosted objects with the same framework as the parent should be handed with the usual structural change events, such as EVENT_OBJECT_CREATED for MSAA. see above.
EVENT_OBJECT_IME_CHANGE Sent by an IME window whenever it changes size or position.
EVENT_OBJECT_IME_SHOW/HIDE Sent by an IME window when it has become visible or invisible.
EVENT_OBJECT_LIVEREGIONCHANGED Sent when an object that is part of a live region changes. A live region is an area of an application that changes frequently and/or asynchronously, so that an assistive technology tool might want to pay special attention to it.
Note: A LOCATIONCHANGE is not sent for every child object when the parent changes shape/moves. Send one notification for the topmost object that is changing. For example, if the user resizes a top level window, USER will generate a LOCATIONCHANGE for it, but not for the menu bar, title bar, scrollbars, etc. that are also changing shape/moving. In other words, it only generates LOCATIONCHANGE notifications for real windows that are moving/sizing. It will not generate a LOCATIONCHANGE for every non-floating child window when the parent moves (the children are logically moving also on screen, but not relative to the parent). Now, if the app itself resizes child windows as a result of being sized, USER will generate LOCATIONCHANGEs for those dudes also because it doesn't know better. Note also that USER will generate LOCATIONCHANGE notifications for two non-window sys objects: (1) System caret (2) Cursor
NOTES: There is only one "focused" child item in a parent. This is the place keystrokes are going at a given moment. Hence only send a notification about where the NEW focus is going. A NEW item getting the focus already implies that the OLD item is losing it. SELECTION however can be multiple. Hence the different SELECTION notifications. Here's when to use each: (1) Send a SELECTION notification in the simple single selection case (like the focus) when the item with the selection is merely moving to a different item within a container. hwnd + ID is the container control, idChildItem is the new child with the selection. (2) Send a SELECTIONADD notification when a new item has simply been added to the selection within a container. This is appropriate when the number of newly selected items is very small. hwnd + ID is the container control, idChildItem is the new child added to the selection. (3) Send a SELECTIONREMOVE notification when a new item has simply been removed from the selection within a container. This is appropriate when the number of newly selected items is very small, just like SELECTIONADD. hwnd + ID is the container control, idChildItem is the new child removed from the selection. (4) Send a SELECTIONWITHIN notification when the selected items within a control have changed substantially. Rather than propagate a large number of changes to reflect removal for some items, addition of others, just tell somebody who cares that a lot happened. It will be faster an easier for somebody watching to just turn around and query the container control what the new bunch of selected items are.
Examples of when to send an EVENT_OBJECT_STATECHANGE include
EVENT_SYSTEM_ALERT System Alerts: (Generated by MessageBox() calls for example) hwnd is hwndMessageBox idObject is OBJID_ALERT App Alerts: (Generated whenever) hwnd+idObject gets interface pointer to Alert System Alerts (indexChild of system ALERT notification)
define ALERT_SYSTEM_INFORMATIONAL 1 // MB_INFORMATION
define ALERT_SYSTEM_WARNING 2 // MB_WARNING
define ALERT_SYSTEM_ERROR 3 // MB_ERROR
define ALERT_SYSTEM_QUERY 4 // MB_QUESTION
define ALERT_SYSTEM_CRITICAL 5 // HardSysErrBox
define CALERT_SYSTEM 6
EVENT_SYSTEM_CAPTURESTART EVENT_SYSTEM_CAPTUREEND Sent when a window takes the capture and releases the capture.
Context Help EVENT_SYSTEM_CONTEXTHELPSTART EVENT_SYSTEM_CONTEXTHELPEND Sent when a window enters and leaves context sensitive help mode.
Dialog Send the START notification right after the dialog is completely initialized and visible. Send the END right before the dialog is hidden and goes away. EVENT_SYSTEM_DIALOGSTART EVENT_SYSTEM_DIALOGEND
Drag and Drop EVENT_SYSTEM_DRAGDROPSTART EVENT_SYSTEM_DRAGDROPEND Send the START notification just before going into drag and drop loop. Send the END notification just after canceling out. Note that it is up to apps and OLE to generate this, since the system doesn't know. Like EVENT_SYSTEM_SOUND, it will be a while before this is prevalent.
EVENT_SYSTEM_FOREGROUND Sent when the foreground (active) window changes, even if it is changing to another window in the same thread as the previous one. hwnd is hwndNewForeground idObject is OBJID_WINDOW idChild is INDEXID_OBJECT
Sent when an IME's soft key is pressed and should be echoed, but is not passed through the keyboard hook. Must not be sent when a key is sent through the keyboard hook. HWND is the hwnd of the UI containing the soft key idChild is the Unicode value of the character entered idObject is a bitfield 0x00000001: set if a 32-bit Unicode surrogate pair is used
EVENT_SYSTEM_MENUPOPUPSTART EVENT_SYSTEM_MENUPOPUPEND Sent when a menu popup comes up and just before it is taken down. Note that for a call to TrackPopupMenu(), a client will see EVENT_SYSTEM_MENUSTART followed almost immediately by EVENT_SYSTEM_MENUPOPUPSTART for the popup being shown. For MENUPOPUP, hwnd+idObject+idChild refers to the NEW popup coming up, not the parent item which is hierarchical. You can get the parent menu/popup by asking for the accParent object.
Menu hwnd is window (top level window or popup menu window) idObject is ID of control (OBJID_MENU, OBJID_SYSMENU, OBJID_SELF for popup) idChild is CHILDID_SELF EVENT_SYSTEM_MENUSTART EVENT_SYSTEM_MENUEND For MENUSTART, hwnd+idObject+idChild refers to the control with the menu bar, or the control bringing up the context menu. Sent when entering into and leaving from menu mode (system, app bar, and track popups).
EVENT_SYSTEM_MINIMIZESTART EVENT_SYSTEM_MINIMIZEEND Sent when a window minimizes and just before it restores.
Move Size EVENT_SYSTEM_MOVESIZESTART EVENT_SYSTEM_MOVESIZEEND Sent when a window enters and leaves move-size dragging mode.
EVENT_SYSTEM_SCROLLING EVENT_SYSTEM_SCROLLINGSTART EVENT_SYSTEM_SCROLLINGEND Sent when beginning and ending the tracking of a scrollbar in a window, and also for scrollbar controls.
System events EVENT_SYSTEM_SOUND Sent when a sound is played. Currently nothing is generating this, we this event when a system sound (for menus, etc) is played. Apps generate this, if accessible, when a private sound is played. For example, if Mail plays a "New Mail" sound. System Sounds: (Generated by PlaySoundEvent in USER itself) hwnd is NULL idObject is OBJID_SOUND idChild is sound child ID if one App Sounds: (PlaySoundEvent won't generate notification; up to app) hwnd + idObject gets interface pointer to Sound object idChild identifies the sound in question are going to be cleaning up the SOUNDSENTRY feature in the control panel and will use this at that time. Applications implementing WinEvents are perfectly welcome to use it. Clients of IAccessible* will simply turn around and get back a non-visual object that describes the sound.
Dropped: HWND = hwnd of app thumbnail, objectID = same, childID = 0
AppGrabbed: HWND = hwnd of app thumbnail, objectID = 0, childID = 0
OverTarget: HWND = hwnd of app thumbnail, objectID = 1 for center 2 for near snapped 3 for far snapped 4 for prune childID = 0
Cancelled: HWND = hwnd of app thumbnail, objectID = 0, childID = 0
Alt-Tab Window Send the START notification right after the switch window is initialized and visible. Send the END right before it is hidden and goes away. EVENT_SYSTEM_SWITCHSTART EVENT_SYSTEM_SWITCHEND