User32CreateIconFromResourceEx Method
Creates an icon or cursor from resource bits describing the icon.
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 IntPtr CreateIconFromResourceEx(
ref byte refResourceBits,
uint resourceSize,
bool isIcon,
uint version,
int width,
int height,
CreateIconFromResourceFlags flags
)
<DllImportAttribute("User32.dll", SetLastError := true>]
Public Shared Function CreateIconFromResourceEx (
ByRef refResourceBits As Byte,
resourceSize As UInteger,
isIcon As Boolean,
version As UInteger,
width As Integer,
height As Integer,
flags As CreateIconFromResourceFlags
) As IntPtr
Dim refResourceBits As Byte
Dim resourceSize As UInteger
Dim isIcon As Boolean
Dim version As UInteger
Dim width As Integer
Dim height As Integer
Dim flags As CreateIconFromResourceFlags
Dim returnValue As IntPtr
returnValue = User32.CreateIconFromResourceEx(refResourceBits,
resourceSize, isIcon, version, width,
height, flags)
public:
[DllImportAttribute(L"User32.dll", SetLastError = true)]
static IntPtr CreateIconFromResourceEx(
unsigned char% refResourceBits,
unsigned int resourceSize,
bool isIcon,
unsigned int version,
int width,
int height,
CreateIconFromResourceFlags flags
)
[<DllImportAttribute("User32.dll", SetLastError = true)>]
static member CreateIconFromResourceEx :
refResourceBits : byte byref *
resourceSize : uint32 *
isIcon : bool *
version : uint32 *
width : int *
height : int *
flags : CreateIconFromResourceFlags -> IntPtr
No code example is currently available or this language may not be supported.
- refResourceBits Byte
-
The buffer containing the icon or cursor resource bits.
These bits are typically loaded by calls to the LookupIconIdFromDirectoryEx
and LoadResource(SafeModuleHandle, IntPtr) functions.
- resourceSize UInt32
-
The size, in bytes, of the set of bits pointed to by the refResourceBits parameter.
- isIcon Boolean
-
Indicates whether an icon or a cursor is to be created.
If this parameter is , an icon is to be created.
If it is , a cursor is to be created.
- version UInt32
-
The version number of the icon or cursor format for the resource bits pointed to by the presbits parameter.
The value must be greater than or equal to 0x00020000 (&H20000 in VB.NET)
and less than or equal to 0x00030000 (&H30000 in VB.NET).
This parameter is generally set to 0x00030000 (&H30000 in VB.NET).
- width Int32
-
The desired width, in pixels, of the icon or cursor.
If this parameter is zero, the function uses the SM_CXICON or SM_CXCURSOR system metric value to set the width.
- height Int32
-
The desired height, in pixels, of the icon or cursor.
If this parameter is zero, the function uses the SM_CYICON or SM_CYCURSOR system metric value to set the height.
- flags CreateIconFromResourceFlags
-
Flags that determine how the icon is created.
IntPtr
If the function succeeds, the return value is a handle to the icon or cursor.
If the function fails, the return value is
Zero.
To get extended error information, call
GetLastWin32Error.