Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

A window that receives keyboard input typically displays the characters that the user types in the window client area. A window should use a caret to indicate the position in the client area where the next character will appear. The window should create and display the caret when it receives the keyboard focus, and it should hide and destroy the caret when it loses the focus. A window can perform these operations when the WM_SETFOCUSand WM_KILLFOCUSmessages are processed, respectively.

Use the CreateCaret, ShowCaret, DestroyCaret, and HideCaretfunctions to control the visibility of the caret. Use the SetCaretPosfunction to change the position of the caret as the user types.

See Also