Caret

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.

Supported Properties and Methods

  • accHitTest
    accLocation
    get_accChildCount
    The ChildCount 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 are:

Events Generated

EVENT_OBJECT_CREATE

EVENT_OBJECT_DESTROY

EVENT_OBJECT_SHOW

EVENT_OBJECT_HIDE

EVENT_OBJECT_LOCATIONCHANGE

Remarks

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 callback function 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 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.

See Also

IAccessible Interface