diff --git a/PInvoke/Ole/PropSys/PropSys.cs b/PInvoke/Ole/PropSys/PropSys.cs index 7d42b5e8..9a86d74d 100644 --- a/PInvoke/Ole/PropSys/PropSys.cs +++ b/PInvoke/Ole/PropSys/PropSys.cs @@ -491,8 +491,8 @@ namespace Vanara.PInvoke /// A reference to a PROPVARIANT structure that contains the type and value of the property. /// One or more of the PROPDESC_FORMAT_FLAGS flags, which are either bitwise or multiple values, that indicate the property string format. /// When this method returns, contains the formatted value as a null-terminated, Unicode string. The calling application must allocate memory for the buffer, and use CoTaskMemFree to release the string specified by pszText when it is no longer needed. - /// The length of the buffer at pszText in WCHARS, including the terminating NULL. The maximum size is 0x8000 (32K). - uint FormatForDisplay([In] ref PROPERTYKEY key, [In] PROPVARIANT propvar, [In] PROPDESC_FORMAT_FLAGS pdfFlags, [Out, MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(CoTaskMemStringMarshaler))] out string pszText); + /// The length of the buffer at pszText in WCHARS, including the terminating NULL. The maximum size is 0x8000 (32K). + void FormatForDisplay([In] ref PROPERTYKEY key, [In] PROPVARIANT propvar, [In] PROPDESC_FORMAT_FLAGS pdfFlags, System.Text.StringBuilder pszText, uint cchText); /// Gets a value that indicates whether a property is canonical according to the definition of the property description. /// A reference to a PROPVARIANT structure that contains the type and value of the property. /// Returns one of the following values: S_OK = The value is canonical; S_FALSE = The value is not canonical. @@ -500,6 +500,70 @@ namespace Vanara.PInvoke HRESULT IsValueCanonical([In] PROPVARIANT propvar); } + [ComImport, Guid("11E1FBF9-2D56-4A6B-8DB3-7CD193A471F2"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [PInvokeData("Propsys.h")] + public interface IPropertyEnumType + { + PROPENUMTYPE GetEnumType(); + + PROPVARIANT GetValue(); + + PROPVARIANT GetRangeMinValue(); + + PROPVARIANT GetRangeSetValue(); + + SafeCoTaskMemString GetDisplayText(); + } + + /// Property Enumeration Types + public enum PROPENUMTYPE + { + /// Use DisplayText and either RangeMinValue or RangeSetValue. + PET_DISCRETEVALUE = 0, + + /// Use DisplayText and either RangeMinValue or RangeSetValue + PET_RANGEDVALUE = 1, + + /// Use DisplayText + PET_DEFAULTVALUE = 2, + + /// Use Value or RangeMinValue + PET_ENDRANGE = 3 + } + + [ComImport, Guid("9B6E051C-5DDD-4321-9070-FE2ACB55E794"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [PInvokeData("Propsys.h")] + public interface IPropertyEnumType2 : IPropertyEnumType + { + new PROPENUMTYPE GetEnumType(); + + new PROPVARIANT GetValue(); + + new PROPVARIANT GetRangeMinValue(); + + new PROPVARIANT GetRangeSetValue(); + + new SafeCoTaskMemString GetDisplayText(); + + SafeCoTaskMemString GetImageReference(); + } + + + [ComImport, Guid("A99400F4-3D84-4557-94BA-1242FB2CC9A6"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + [PInvokeData("Propsys.h")] + public interface IPropertyEnumTypeList + { + uint GetCount(); + + [return: MarshalAs(UnmanagedType.Interface)] + IPropertyEnumType GetAt([In] uint itype, [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid); + + [return: MarshalAs(UnmanagedType.Interface)] + object GetConditionAt([In] uint index, [In, MarshalAs(UnmanagedType.LPStruct)] Guid riid); + + uint FindMatchingIndex([In] PROPVARIANT propvarCmp); + } + [SuppressUnmanagedCodeSecurity] [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("886d8eeb-8cf2-4446-8d02-cdba1dbdcf99")] [PInvokeData("Shobjidl.h", MSDNShortId = "bb762502")]