Share via


ShowCaret

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

This function makes the caret visible on the screen at the caret's current position. When the caret becomes visible, it begins flashing automatically.

Syntax

BOOL ShowCaret(
  HWND hWnd
); 

Parameters

  • hWnd
    [in] Handle to the window that owns the caret. If this parameter is NULL, ShowCaret searches the current task for the window that owns the caret.

Return Value

Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.

Remarks

ShowCaret shows the caret if the specified window owns the caret and the caret has a shape. If either of these conditions is not met, ShowCaret displays nothing and returns zero. If the caret has been hidden two or more times in a row, ShowCaret displays nothing, but returns a nonzero value.

Hiding is cumulative. If your application calls HideCaret five times in a row, it must also call ShowCaret five times before the caret reappears.

The system provides one caret per queue. A window should create a caret only when it has the keyboard focus or is active. The window should destroy the caret before losing the keyboard focus or becoming inactive.

Requirements

Header winuser.h
Library Caret.lib
Windows Embedded CE Windows CE 1.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

CreateCaret
DestroyCaret
GetCaretPos
HideCaret
SetCaretPos
Carets Functions