User32LoadIcon Method
Loads the specified icon resource from the executable (.exe) file associated with an application instance.
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", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
public static IntPtr LoadIcon(
IntPtr hInstance,
string name
)
<DllImportAttribute("User32.dll", CharSet := CharSet.Auto, BestFitMapping := false,
ThrowOnUnmappableChar := true, SetLastError := true>]
Public Shared Function LoadIcon (
hInstance As IntPtr,
name As String
) As IntPtr
Dim hInstance As IntPtr
Dim name As String
Dim returnValue As IntPtr
returnValue = User32.LoadIcon(hInstance,
name)
public:
[DllImportAttribute(L"User32.dll", CharSet = CharSet::Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)]
static IntPtr LoadIcon(
IntPtr hInstance,
[InAttribute] String^ name
)
[<DllImportAttribute("User32.dll", CharSet = CharSet.Auto, BestFitMapping = false,
ThrowOnUnmappableChar = true, SetLastError = true)>]
static member LoadIcon :
hInstance : IntPtr *
name : string -> IntPtr
No code example is currently available or this language may not be supported.
- 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.
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.