GetCaretPos function (winuser.h)

Copies the caret's position to the specified POINT structure.

Syntax

BOOL GetCaretPos(
  [out] LPPOINT lpPoint
);

Parameters

[out] lpPoint

Type: LPPOINT

A pointer to the POINT structure that is to receive the client coordinates of the caret.

Return value

Type: BOOL

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The caret position is always given in the client coordinates of the window that contains the caret.

DPI Virtualization

This API does not participate in DPI virtualization. The returned values are interpreted as logical sizes in terms of the window in question. The calling thread is not taken into consideration.

Requirements

Requirement Value
Minimum supported client Windows 2000 Professional [desktop apps only]
Minimum supported server Windows 2000 Server [desktop apps only]
Target Platform Windows
Header winuser.h (include Windows.h)
Library User32.lib
DLL User32.dll
API set ext-ms-win-ntuser-caret-l1-1-0 (introduced in Windows 8)

See also

Carets

Conceptual

Other Resources

POINT

Reference

SetCaretPos