User32LoadCursor Method

Loads the specified cursor resource from the executable (.EXE) file associated with an application instance.

Note: This function has been superseded by the LoadImage(IntPtr, String, LoadImageType, Int32, Int32, LoadImageFlags) function.

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", BestFitMapping = false, ThrowOnUnmappableChar = true, 
	SetLastError = true)]
public static IntPtr LoadCursor(
	IntPtr hInstance,
	string cursorName
)

Parameters

hInstance  IntPtr
A handle to an instance of the module whose executable file contains the cursor to be loaded.
cursorName  String
The name of the cursor resource to be loaded.

Alternatively, this parameter can consist of the resource identifier in the low-order word and zero in the high-order word.

To use one of the predefined cursors, the application must set the hInstance parameter to Zero and the cursorName parameter to the predefined cursor name (eg. "IDC_ARROW", "IDC_CROSS", "IDC_HAND", "IDC_HELP", "IDC_IBEAM", "IDC_WAIT", etc).

Return Value

IntPtr
If the function succeeds, the return value is the handle to the newly loaded cursor.

If the function fails, the return value is Zero.

To get extended error information, call GetLastWin32Error.

Remarks

See Also