diff --git a/PInvoke/Shell32/ShObjIdl.IExtractImage.cs b/PInvoke/Shell32/ShObjIdl.IExtractImage.cs
index 8f34a0e2..916ffb34 100644
--- a/PInvoke/Shell32/ShObjIdl.IExtractImage.cs
+++ b/PInvoke/Shell32/ShObjIdl.IExtractImage.cs
@@ -1,12 +1,14 @@
using System;
using System.Runtime.InteropServices;
using System.Text;
+using static Vanara.PInvoke.Gdi32;
using FILETIME = System.Runtime.InteropServices.ComTypes.FILETIME;
namespace Vanara.PInvoke
{
public static partial class Shell32
{
+ /// Flags that specifiy how to handle the image.
[Flags]
public enum IEIFLAG
{
@@ -101,8 +103,18 @@ namespace Vanara.PInvoke
HRESULT GetLocation([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszPathBuffer, uint cchMax, [Optional] IntPtr pdwPriority, ref SIZE prgSize, uint dwRecClrDepth, ref IEIFLAG pdwFlags);
/// Requests an image from an object, such as an item in a Shell folder.
- /// The HBITMAP of the image.
- HBITMAP Extract();
+ ///
+ /// Type: HBITMAP*
+ /// The buffer to hold the bitmapped image.
+ ///
+ ///
+ /// Type: HRESULT
+ /// Returns S_OK if successful, or a COM-defined error code otherwise.
+ ///
+ /// You must call IExtractImage::GetLocation prior to calling Extract.
+ // https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-iextractimage-extract
+ [PreserveSig]
+ HRESULT Extract(out SafeHBITMAP phBmpThumbnail);
}
/// Extends the capabilities of IExtractImage.
@@ -153,19 +165,31 @@ namespace Vanara.PInvoke
new HRESULT GetLocation([Out, MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszPathBuffer, uint cchMax, [Optional] IntPtr pdwPriority, ref SIZE prgSize, uint dwRecClrDepth, ref IEIFLAG pdwFlags);
/// Requests an image from an object, such as an item in a Shell folder.
- /// The HBITMAP of the image.
- new HBITMAP Extract();
-
- ///
- /// Requests the date the image was last modified. This method allows the Shell to determine whether cached images are out-of-date.
- ///
+ ///
+ /// Type: HBITMAP*
+ /// The buffer to hold the bitmapped image.
+ ///
///
+ /// Type: HRESULT
+ /// Returns S_OK if successful, or a COM-defined error code otherwise.
+ ///
+ /// You must call IExtractImage::GetLocation prior to calling Extract.
+ // https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-iextractimage-extract
+ [PreserveSig]
+ new HRESULT Extract(out SafeHBITMAP phBmpThumbnail);
+
+ /// Requests the date the image was last modified. This method allows the Shell to determine whether cached images are out-of-date.
+ ///
/// Type: FILETIME*
/// A pointer to a FILETIME structure used to return the last time the image was modified.
+ ///
+ ///
+ /// Type: HRESULT
+ /// Return S_OK if successful, or a COM-defined error code otherwise.
///
- // https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-iextractimage2-getdatestamp HRESULT
- // GetDateStamp( FILETIME *pDateStamp );
- FILETIME GetDateStamp();
+ // https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-iextractimage2-getdatestamp
+ [PreserveSig]
+ HRESULT GetDateStamp(out FILETIME pDateStamp);
}
}
}
\ No newline at end of file