ShowCaret

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

At a Glance

Header file: Winuser.h
Windows CE versions: 1.0 and later

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 Values

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.

See Also

CreateCaret, DestroyCaret, GetCaretPos, HideCaret, SetCaretPos