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.
Namespace: DevCase.Win32.NativeMethodsAssembly: 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
)
<DllImportAttribute("User32.dll", SetLastError := true>]
Public Shared Function CreateCaret (
hWnd As SafeHandle,
bitmap As IntPtr,
width As Integer,
nHeight As Integer
) As Boolean
Dim hWnd As SafeHandle
Dim bitmap As IntPtr
Dim width As Integer
Dim nHeight As Integer
Dim returnValue As Boolean
returnValue = User32.CreateCaret(hWnd,
bitmap, width, nHeight)
public:
[DllImportAttribute(L"User32.dll", SetLastError = true)]
static bool CreateCaret(
SafeHandle^ hWnd,
IntPtr bitmap,
int width,
int nHeight
)
[<DllImportAttribute("User32.dll", SetLastError = true)>]
static member CreateCaret :
hWnd : SafeHandle *
bitmap : IntPtr *
width : int *
nHeight : int -> bool
No code example is currently available or this language may not be supported.
- 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.
Boolean
If the function succeeds, the return value is
.
If the function fails, the return value is
.
To get extended error information, call
GetLastWin32Error.