User32SetCursor Method

Sets the cursor shape.

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", ExactSpelling = true, SetLastError = true)]
public static IntPtr SetCursor(
	IntPtr hCursor
)

Parameters

hCursor  IntPtr
A handle to the cursor.

The cursor must have been created by the CreateCursor function or loaded by the LoadCursor(IntPtr, String) or LoadImage(IntPtr, String, LoadImageType, Int32, Int32, LoadImageFlags) function.

If this parameter is Zero, the cursor is removed from the screen.

Return Value

IntPtr
The return value is the handle to the previous cursor, if there was one.

If there was no previous cursor, the return value is Zero.

To get extended error information, call GetLastWin32Error.

Remarks

See Also