User32LoadIcon Method

Loads the specified icon resource from the executable (.exe) file associated with an application instance.

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", CharSet = CharSet.Auto, BestFitMapping = false, 
	ThrowOnUnmappableChar = true, SetLastError = true)]
public static IntPtr LoadIcon(
	IntPtr hInstance,
	string name
)

Parameters

hInstance  IntPtr
A handle to an instance of the module whose executable file contains the icon to be loaded.

This parameter must be Zero when a standard icon is being loaded.

name  String
The name of the icon resource to be loaded.

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

Return Value

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

If the function fails, the return value is Zero.

To get extended error information, call GetLastWin32Error.

Remarks

See Also