|
// ------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
// ------------------------------------------------------------------------------
#pragma warning disable CS1591,CS1573,CS0465,CS0649,CS8019,CS1570,CS1584,CS1658,CS0436,CS8981
using global::System;
using global::System.Diagnostics;
using global::System.Diagnostics.CodeAnalysis;
using global::System.Runtime.CompilerServices;
using global::System.Runtime.InteropServices;
using global::System.Runtime.Versioning;
using winmdroot = global::Windows.Win32;
namespace Windows.Win32
{
/// <content>
/// Contains extern methods from "USER32.dll".
/// </content>
internal static partial class PInvoke
{
/// <summary>Creates an icon or cursor from resource bits describing the icon. (CreateIconFromResourceEx)</summary>
/// <param name="presbits">
/// <para>Type: <b>PBYTE</b> The icon or cursor resource bits. These bits are typically loaded by calls to the <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-lookupiconidfromdirectoryex">LookupIconIdFromDirectoryEx</a> and <a href="https://docs.microsoft.com/windows/desktop/api/libloaderapi/nf-libloaderapi-loadresource">LoadResource</a> functions.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-createiconfromresourceex#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="dwResSize">
/// <para>Type: <b>DWORD</b> The size, in bytes, of the set of bits pointed to by the <i>pbIconBits</i> parameter.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-createiconfromresourceex#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="fIcon">
/// <para>Type: <b>BOOL</b> Indicates whether an icon or a cursor is to be created. If this parameter is <b>TRUE</b>, an icon is to be created. If it is <b>FALSE</b>, a cursor is to be created.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-createiconfromresourceex#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="dwVer">
/// <para>Type: <b>DWORD</b> The version number of the icon or cursor format for the resource bits pointed to by the <i>pbIconBits</i> parameter. The value must be greater than or equal to 0x00020000 and less than or equal to 0x00030000. This parameter is generally set to 0x00030000.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-createiconfromresourceex#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="cxDesired">
/// <para>Type: <b>int</b> The desired width, in pixels, of the icon or cursor. If this parameter is zero, the function uses the <b>SM_CXICON</b> or <b>SM_CXCURSOR</b> system metric value to set the width.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-createiconfromresourceex#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="cyDesired">
/// <para>Type: <b>int</b> The desired height, in pixels, of the icon or cursor. If this parameter is zero, the function uses the <b>SM_CYICON</b> or <b>SM_CYCURSOR</b> system metric value to set the height.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-createiconfromresourceex#parameters">Read more on docs.microsoft.com</see>.</para>
/// </param>
/// <param name="Flags">Type: <b>UINT</b></param>
/// <returns>
/// <para>Type: <b>HICON</b> If the function succeeds, the return value is a handle to the icon or cursor. If the function fails, the return value is <b>NULL</b>. To get extended error information, call <a href="https://docs.microsoft.com/windows/desktop/api/errhandlingapi/nf-errhandlingapi-getlasterror">GetLastError</a>.</para>
/// </returns>
/// <remarks>
/// <para>The <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-createiconfromresource">CreateIconFromResource</a>, <b>CreateIconFromResourceEx</b>, <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-createiconindirect">CreateIconIndirect</a>, <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-geticoninfo">GetIconInfo</a>, and <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-lookupiconidfromdirectoryex">LookupIconIdFromDirectoryEx</a> functions allow shell applications and icon browsers to examine and use resources throughout the system. You should call <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-destroyicon">DestroyIcon</a> for icons created with <b>CreateIconFromResourceEx</b>.</para>
/// <para><see href="https://learn.microsoft.com/windows/win32/api/winuser/nf-winuser-createiconfromresourceex#">Read more on docs.microsoft.com</see>.</para>
/// </remarks>
[SupportedOSPlatform("windows5.0")]
internal static unsafe winmdroot.UI.WindowsAndMessaging.HICON CreateIconFromResourceEx(byte* presbits, uint dwResSize, winmdroot.Foundation.BOOL fIcon, uint dwVer, int cxDesired, int cyDesired, winmdroot.UI.WindowsAndMessaging.IMAGE_FLAGS Flags)
{
Marshal.SetLastSystemError(0);
winmdroot.UI.WindowsAndMessaging.HICON __retVal = LocalExternFunction(presbits, dwResSize, fIcon, dwVer, cxDesired, cyDesired, Flags);
Marshal.SetLastPInvokeError(Marshal.GetLastSystemError());
return __retVal;
[DllImport("USER32.dll", ExactSpelling = true, EntryPoint = "CreateIconFromResourceEx"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
static extern unsafe winmdroot.UI.WindowsAndMessaging.HICON LocalExternFunction(byte* presbits, uint dwResSize, winmdroot.Foundation.BOOL fIcon, uint dwVer, int cxDesired, int cyDesired, winmdroot.UI.WindowsAndMessaging.IMAGE_FLAGS Flags);
}
}
}
|