IAccessible Methods and Properties


objHit = object.accClick(objID, button, x, y, shift, ctrl, alt)

Generates a real mouse click at the given coordinates, or if no coordinates are specified, in the middle of the object or the specified child. The application is brought to the foreground if necessary.

Parameters

objID
Optional. Either an integer specifying an accessible child object, or a string containing the child name. The string can be a regular expression. Default value is 0, specifying the object itself, rather than a child.
button
Optional. What button to use for click. Default is consts.MB_LEFTBUTTON.
x, y
Optional. Window relative coordinates where the click should occur. Default values are (-1, -1) and they are replaced by Q1 with the center of the current window.
shift, ctrl, alt
Optional. Flags specifying which control keys to keep pressed while generating the click. By default no keys are pressed.

objHit = object.accDblClick(objID, button, x, y, shift, ctrl, alt)

Generates a real mouse double click at the given coordinates, or if no coordinates are specified, in the middle of the object or the specified child. The application is brought to the foreground if necessary.

Parameters

objID
Optional. Either an integer specifying an accessible child object, or a string containing the child name. The string can be a regular expression. Default value is 0, specifying the object itself, rather than a child.
button
Optional. What button to use for the double click. Default is consts.MB_LEFTBUTTON.
x, y
Optional. Window relative coordinates where the double click should occur. Default values are (-1, -1) and they are replaced by Q1 with the center of the current window.
shift, ctrl, alt
Optional. Flags specifying which control keys to keep pressed while generating the double click. By default no keys are pressed.

objDest = object.accNavigate(navDirection, objIDStart)

Navigates to another user interface object in the specified direction. MS Accessibility supports both spatial navigation (such as left or right), and logical navigation (such as next or previous).

Parameters

navDirection
Direction to navigate, can be one of the consts.NAVDIR_ constants.
objIDStart
Optional. The element to start navigation from. Either an integer specifying a simple child element, or a string containing the child name. The string can be a regular expression. Default value is 0, specifying the object itself, rather than a child.

objChild = object.accChild(objID)

Returns a child object specified by objID, but only if such a child is a full object.

Parameters

objID
Optional. Either an integer specifying an accessible child object, or a string containing the child name. The string can be a regular expression. Default value is 0, specifying the object itself, rather than a child.

count = object.accChildCount()

Returns the number of children for this accessible object.

objParent = object.accParent()

Returns object which contains this accessible object.

object.accDoDefaultAction(objID)

Performs the default action on this object, if one is defined. For example the default action for a push button is 'click'.

Parameters

objID
Optional. Either an integer specifying a simple child element, or a string containing the child name. The string can be a regular expression. Default value is 0, specifying the object itself, rather than a child.

strActionDesc = object.accDefaultAction(objID)

Returns the name of the default action for the object, or the specified child.

Parameters

objID
Optional. Either an integer specifying a simple child element, or a string containing the child name. The string can be a regular expression. Default value is 0, specifying the object itself, rather than a child.

strObjDesc = object.accDescription(objID)

Returns a localized description for the object, or for the specified child.

Parameters

objID
Optional. Either an integer specifying a simple child element, or a string containing the child name. The string can be a regular expression. Default value is 0, specifying the object itself, rather than a child.

strHelpText = object.accHelp(objID)

Returns the Help property string for the object or the specified child, if such a property is defined.

Parameters

objID
Optional. Either an integer specifying a simple child element, or a string containing the child name. The string can be a regular expression. Default value is 0, specifying the object itself, rather than a child.

strShortcut = object.accKeyboardShortcut(objID)

For objects which have an associated key shortcut (mnemonic, accelerator) returns a string describing the key combination.

Parameters

objID
Optional. Either an integer specifying a simple child element, or a string containing the child name. The string can be a regular expression. Default value is 0, specifying the object itself, rather than a child.

strObjName = accName(objID)

Returns the name of the object or the specified child. For some controls the name is the text displayed in the title bar (dialogs), while for other it is the static text that immediately precedes the control (its label).

Parameters

objID
Optional. Either an integer specifying a simple child element, or a string containing the child name. The string can be a regular expression. Default value is 0, specifying the object itself, rather than a child.

idRole = object.accRole(objID)

Returns one of the consts.ROLE_SYSTEM_ constants, describing the object's role, or its type.

Parameters

objID
Optional. Either an integer specifying a simple child element, or a string containing the child name. The string can be a regular expression. Default value is 0, specifying the object itself, rather than a child.

idState = object.accState(objID)

Returns a combination of the consts.STATE_SYSTEM_ constants, describing the object's state. For convenience Q1 provides a list of boolean properties (such as accIsChecked, accIsSelected) that you can use instead of accState (see wnd Overview).

Parameters

objID
Optional. Either an integer specifying a simple child element, or a string containing the child name. The string can be a regular expression. Default value is 0, specifying the object itself, rather than a child.

strValue = object.accValue(objID)

Returns the value of the specified object or child. The value of an object depends on the object's type, for example an edit control will have its text as its value, while a progress bar will have a integer value between 0 and 100.

Parameters

objID
Optional. Either an integer specifying a simple child element, or a string containing the child name. The string can be a regular expression. Default value is 0, specifying the object itself, rather than a child.

object.accSelect(objID, flagSelect)

Modifies the selection or changes the keyboard focus. The same method can be used to select, unselect, add to selection (for multiple selection controls) or take the keyboard focus.

Parameters

objID
Optional. Either an integer specifying a simple child element, or a string containing the child name. The string can be a regular expression. Default value is 0, specifying the object itself, rather than a child.
flagSelect
Optional. A combination of the consts.SELFLAG constants. Default value is consts.SELFLAG_TAKESELECTION which selects a single item.

objFocus = object.accFocus()

Returns the child object which has the keyboard focus. The return value can be either a full object, or just an integer specifying a simple element ID. If the control itself has the focus, return value is 0.

objSelection = object.accSelection()

Returns the child object or objects which are selected. If only one child is selected, the return value is either a full object or a child ID, with 0 specifying that the object itself is selected. If selection contains multiple objects then a collection is returned, with each element being either a full object or a child ID.

accLocation(nRefLeft, nRefTop, nRefWidth, nRefHeight, objID)

Returns the object's screen location. This is just a bounding box, use accHitTest for non-rectangular controls.

Parameters

nRefLeft, nRefTop, nRefWidth, nRefHeight
Will receive the left, top, width and height values of the boundaries of the object's location, in screen coordinates.
objID
Optional. Either an integer specifying a simple child element, or a string containing the child name. The string can be a regular expression. Default value is 0, specifying the object itself, rather than a child.

objHit = object.accHitTest(nLeft, nTop)

Returns the child object located at the given coordinates on the screen. The return value can be either a full object or a child ID.

Parameters

nLeft, nTop
Screen coordinates to test for an object.

See also

wnd Overview | MS Accessibility

 


© 2003 Lightweight Technologies. All rights reserved.