Caret (MSAA UI Element Reference)

Note  This topic describes carets for purposes of MSAA UI Element Reference. How to use carets in various UI frameworks is not described here. See the API reference documentation for the UI framework you're using.

The caret is a flashing line, block, or bitmap in the client area of a window or in a control that accepts keyboard input. It indicates the place at which text or graphics are inserted. Because only one window at a time has the keyboard focus, there is only one caret in the system.

IAccessible Methods

The caret supports the following IAccessible methods:

IAccessible Properties

The caret supports the following IAccessible properties:

get_accChildCount The ChildCount property is zero.
get_accName The Name property is "Edit".
get_accRole The Role property is ROLE_SYSTEM_CARET.
get_accState Possible values for the State property include:



  • Unlike other UI elements, the caret object does not have an associated window handle. To obtain access to the caret object, clients must set a WinEventProc and wait for the caret object to generate events.
  • The caret object in the rich edit control provided by Riched20.dll (which is used in text editors such as Microsoft WordPad in Windows 98) does not send any WinEvents when its position is changed during text selection. When users press SHIFT and arrow keys to select text, the caret object does not trigger the EVENT_OBJECT_LOCATIONCHANGE WinEvent. Similarly, when the selection is set programmatically through rich edit messages, the caret object does not send any events to indicate its new position.

    All applications that use Riched20.dll exhibit this problem. Applications using earlier versions of the rich edit control correctly send events based on the selection.

Related topics

IAccessible Interface