File: Windows.Win32.PInvoke.SHELL32.dll.g.cs
Project: src\src\System.Drawing.Common\src\System.Drawing.Common.csproj (System.Drawing.Common)
// ------------------------------------------------------------------------------
// <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 "SHELL32.dll".
	/// </content>
	internal static partial class PInvoke
	{
		/// <summary>Gets a handle to an icon stored as a resource in a file or an icon stored in a file's associated executable file. (Unicode)</summary>
		/// <param name="hInst">
		/// <para>Type: <b>HINSTANCE</b> A handle to the instance of the calling application.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/shellapi/nf-shellapi-extractassociatediconw#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="pszIconPath">
		/// <para>Type: <b>LPTSTR</b> Pointer to a string that, on entry, specifies the full path and file name of the file that contains the icon. The function extracts the icon handle from that file, or from an executable file associated with that file.</para>
		/// <para>When this function returns, if the icon handle was obtained from an executable file (either an executable file pointed to by <i>lpIconPath</i> or an associated executable file) the function stores the full path and file name of that executable in the buffer pointed to by this parameter.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/shellapi/nf-shellapi-extractassociatediconw#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="piIcon">
		/// <para>Type: <b>LPWORD</b> Pointer to a <b>WORD</b> value that, on entry, specifies the index of the icon whose handle is to be obtained.</para>
		/// <para>When the function returns, if the icon handle was obtained from an executable file (either an executable file pointed to by <i>lpIconPath</i> or an associated executable file), this value points to the icon's index in that file.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/shellapi/nf-shellapi-extractassociatediconw#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <returns>
		/// <para>Type: <b>HICON</b> If the function succeeds, the return value is an icon handle. If the icon is extracted from an associated executable file, the function stores the full path and file name of the executable file in the string pointed to by <i>lpIconPath</i>, and stores the icon's identifier in the <b>WORD</b> pointed to by <i>lpiIcon</i>.</para>
		/// <para>If the function fails, the return value is <b>NULL</b>.</para>
		/// </returns>
		/// <remarks>
		/// <para>When it is no longer needed, the caller is responsible for freeing the icon handle returned by <b>ExtractAssociatedIcon</b> by calling the <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-destroyicon">DestroyIcon</a> function. The <b>ExtractAssociatedIcon</b> function first looks for the indexed icon in the file specified by <i>lpIconPath</i>. If the function cannot obtain the icon handle from that file, and the file has an associated executable file, it looks in that executable file for an icon. Associations with executable files are based on file name extensions and are stored in the per-user part of the registry.</para>
		/// <para>> [!NOTE] > The shellapi.h header defines ExtractAssociatedIcon as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see [Conventions for Function Prototypes](/windows/win32/intl/conventions-for-function-prototypes).</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/shellapi/nf-shellapi-extractassociatediconw#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[DllImport("SHELL32.dll", ExactSpelling = true, EntryPoint = "ExtractAssociatedIconW"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		[SupportedOSPlatform("windows5.1.2600")]
		internal static extern unsafe winmdroot.UI.WindowsAndMessaging.HICON ExtractAssociatedIcon(winmdroot.Foundation.HINSTANCE hInst, winmdroot.Foundation.PWSTR pszIconPath, ushort* piIcon);

		/// <summary>Provides a default handler to extract an icon from a file. (Unicode)</summary>
		/// <param name="pszIconFile">
		/// <para>Type: <b>LPCTSTR</b> A pointer to a null-terminated buffer that contains the path and name of the file from which the icon is extracted.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/shlobj_core/nf-shlobj_core-shdefextracticonw#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="iIndex">
		/// <para>Type: <b>int</b> The location of the icon within the file named in <i>pszIconFile</i>. If this is a positive number, it refers to the zero-based position of the icon in the file. For instance, 0 refers to the 1st icon in the resource file and 2 refers to the 3rd. If this is a negative number, it refers to the icon's resource ID.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/shlobj_core/nf-shlobj_core-shdefextracticonw#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="uFlags">
		/// <para>Type: <b>UINT</b> A flag that controls the icon extraction.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/shlobj_core/nf-shlobj_core-shdefextracticonw#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="phiconLarge">
		/// <para>Type: <b>HICON*</b> A pointer to an HICON that, when this function returns successfully, receives the handle of the large version of the icon specified in the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/ms632659(v=vs.85)">LOWORD</a> of <i>nIconSize</i>. This value can be <b>NULL</b>.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/shlobj_core/nf-shlobj_core-shdefextracticonw#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="phiconSmall">
		/// <para>Type: <b>HICON*</b> A pointer to an HICON that, when this function returns successfully, receives the handle of the small version of the icon specified in the <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/ms632657(v=vs.85)">HIWORD</a> of <i>nIconSize</i>.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/shlobj_core/nf-shlobj_core-shdefextracticonw#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <param name="nIconSize">
		/// <para>Type: <b>UINT</b> A value that contains the large icon size in its <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/ms632659(v=vs.85)">LOWORD</a> and the small icon size in its <a href="https://docs.microsoft.com/previous-versions/windows/desktop/legacy/ms632657(v=vs.85)">HIWORD</a>. Size is measured in pixels. Pass 0 to specify default large and small sizes.</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/shlobj_core/nf-shlobj_core-shdefextracticonw#parameters">Read more on docs.microsoft.com</see>.</para>
		/// </param>
		/// <returns>
		/// <para>Type: <b>HRESULT</b> This function can return one of these values. </para>
		/// <para>This doc was truncated.</para>
		/// </returns>
		/// <remarks>
		/// <para>It is the responsibility of the caller to free the icon resources created through this function when they are no longer needed. This can be done through the <a href="https://docs.microsoft.com/windows/desktop/api/winuser/nf-winuser-destroyicon">DestroyIcon</a> function.</para>
		/// <para>> [!NOTE] > The shlobj_core.h header defines SHDefExtractIcon as an alias which automatically selects the ANSI or Unicode version of this function based on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see [Conventions for Function Prototypes](/windows/win32/intl/conventions-for-function-prototypes).</para>
		/// <para><see href="https://learn.microsoft.com/windows/win32/api/shlobj_core/nf-shlobj_core-shdefextracticonw#">Read more on docs.microsoft.com</see>.</para>
		/// </remarks>
		[DllImport("SHELL32.dll", ExactSpelling = true, EntryPoint = "SHDefExtractIconW"),DefaultDllImportSearchPaths(DllImportSearchPath.System32)]
		[SupportedOSPlatform("windows5.1.2600")]
		internal static extern unsafe winmdroot.Foundation.HRESULT SHDefExtractIcon(winmdroot.Foundation.PCWSTR pszIconFile, int iIndex, uint uFlags, [Optional] winmdroot.UI.WindowsAndMessaging.HICON* phiconLarge, [Optional] winmdroot.UI.WindowsAndMessaging.HICON* phiconSmall, uint nIconSize);
	}
}