diff --git a/PInvoke/Shell32/ShellApi.cs b/PInvoke/Shell32/ShellApi.cs index 5054740c..091f9007 100644 --- a/PInvoke/Shell32/ShellApi.cs +++ b/PInvoke/Shell32/ShellApi.cs @@ -1582,6 +1582,33 @@ namespace Vanara.PInvoke return ret; } + /// Initializes or reinitializes the system image list. + /// + /// Type: BOOL + /// TRUE to restore the system image cache from disk; FALSE otherwise. + /// + /// + /// Type: BOOL + /// TRUE if the cache was successfully refreshed, FALSE if the initialization failed. + /// + /// + /// If you are using system image lists in your own process, you must call FileIconInit at the following times: + /// + /// + /// On launch. + /// + /// + /// In response to a WM_SETTINGCHANGE message when the SPI_SETNONCLIENTMETRICS flag is set. + /// + /// + /// FileIconInit is not included in a header file. You must call it directly from Shell32.dll, using ordinal 660. + /// + // https://docs.microsoft.com/en-us/windows/win32/shell/fileiconinit + // BOOL FileIconInit( _In_ BOOL fRestoreCache ); + [DllImport(Lib.Shell32, SetLastError = false, EntryPoint = "#660")] + [return: MarshalAs(UnmanagedType.Bool)] + public static extern bool FileIconInit([MarshalAs(UnmanagedType.Bool)] bool fRestoreCache); + /// /// Retrieves the name of and handle to the executable (.exe) file associated with a specific document file. /// @@ -4045,6 +4072,9 @@ namespace Vanara.PInvoke /// [MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_PATH)] public string szPath; + + /// The default empty instance of SHSTOCKICONINFO with cbSize set appropriately. + public static readonly SHSTOCKICONINFO Default = new SHSTOCKICONINFO { cbSize = (uint)Marshal.SizeOf(typeof(SHSTOCKICONINFO)) }; } } } \ No newline at end of file