COleControl::ClipCaretRect

Adjusts a caret rectangle if it is entirely or partially covered by overlapping, opaque objects.

BOOL ClipCaretRect(
   LPRECT lpRect 
);

Parameters

  • lpRect
    On input, a pointer to a RECT structure that contains the caret area to be adjusted. On output, the adjusted caret area, or NULL if the caret rectangle is completely covered.

Return Value

Nonzero if successful; otherwise 0.

Remarks

A caret is a flashing line, block, or bitmap that typically indicates where text or graphics will be inserted.

A windowless object cannot safely show a caret without first checking whether the caret is partially or totally hidden by overlapping objects. In order to make that possible, an object can use ClipCaretRect to get the caret adjusted (reduced) to ensure it fits in the clipping region.

Objects creating a caret should submit the caret rectangle to ClipCaretRect and use the adjusted rectangle for the caret. If the caret is entirely hidden, this method will return FALSE and the caret should not be shown at all in this case.

Requirements

Header: afxctl.h

See Also

Concepts

COleControl Class

COleControl Members

Hierarchy Chart