User32CreateCaret(SafeHandle, IntPtr, Int32, Int32) Method

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.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("User32.dll", SetLastError = true)]
public static bool CreateCaret(
	SafeHandle hWnd,
	IntPtr bitmap,
	int width,
	int nHeight
)

Parameters

hWnd  SafeHandle
A handle to the window that owns the caret.
bitmap  IntPtr
A handle to the bitmap that defines the caret shape.

If this parameter is Zero, the caret is solid.

If this parameter is (HBITMAP) New IntPtr(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.

width  Int32
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(IntPtr, IntPtr, Int32, Int32) ignores this parameter.

nHeight  Int32
The height of the caret, in logical units.

If this parameter is zero, the height is set to the system-defined window border height.

If hBitmap is a bitmap handle, CreateCaret(IntPtr, IntPtr, Int32, Int32) ignores this parameter.

Return Value

Boolean
If the function succeeds, the return value is .

If the function fails, the return value is .

To get extended error information, call GetLastWin32Error.

Remarks

See Also