Function:
CreateCaret(HWNDhWnd,HBITMAPhBitmap,intnWidth,intnHeight)

 

Description:
Creates a new shape for the system caret and assigns ownership of the caret to the specified window. The caret shape can be a line, a block, or a bitmap.

 

Parameters:
hWnd: Identifies the window that owns the caret.

hBitmap: Identifies the bitmap that defines the caret shape. If this parameter is NULL, the caret is solid. If this parameter is 1, the caret is gray. If this parameter is a bitmap handle, the caret is the specified bitmap. The bitmap handle must have been created by the CreateBitmap, CreateDIBitmap, or LoadBitmap function (I have not yet tried to assign a bitmap as the caret).

intnWidth: Specifies the width of the caret in logical units If this parameter is zero, the width is set to the system-defined window border width. If hBitmap is a bitmap handle, CreateCaret ignores this parameter.

intnHeight: Specifies the height, in logical units, of the caret. If this parameter is zero, the height is set to the system-defined window border height. If hBitmap is a bitmap handle, CreateCaret ignores this parameter.

 

Returns:
If the function succeeds, the return value is nonzero. If the function fails, the return value is zero.

 

Example:
Select the icon to download the sample caret.a5p. This file demonstrates various caret functions to display a blinking cursor on screen.