using System; using System.Drawing; using System.Runtime.InteropServices; using System.Text; using static Vanara.PInvoke.Ole32; namespace Vanara.PInvoke { public static partial class Shell32 { /// Flags for . [PInvokeData("shobjidl_core.h", MSDNShortId = "72528831-ec5d-417e-94dd-7345b5fd7de6")] public enum FVTEXTTYPE { /// Set the text to display when there are no items in the view. FVST_EMPTYTEXT = 0 } /// /// Exposes methods that retrieve information about a folder's display options, select specified items in that folder, and set the folder's view mode. /// [ComImport, Guid("cde725b0-ccc9-4519-917e-325d72fab4ce"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [PInvokeData("Shobjidl.h", MSDNShortId = "bb761848")] public interface IFolderView { /// Gets an address containing a value representing the folder's current view mode. /// The folder's current view mode. FOLDERVIEWMODE GetCurrentViewMode(); /// Sets the selected folder's view mode. /// One of the following values from the FOLDERVIEWMODE enumeration. void SetCurrentViewMode(FOLDERVIEWMODE ViewMode); /// Gets the folder object. /// Reference to the desired IID to represent the folder. /// When this method returns, contains the interface pointer requested in . This is typically IShellFolder or a related interface. This can also be an IShellItemArray with a single element. void GetFolder(in Guid riid, [MarshalAs(UnmanagedType.IUnknown)] out object ppv); /// Gets the identifier of a specific item in the folder view, by index. /// The index of the item in the view. /// The address of a pointer to a PIDL containing the item's identifier information. void Item(int iItemIndex, out PIDL ppidl); /// Gets the number of items in the folder. This can be the number of all items, or a subset such as the number of selected items. /// Flags from the _SVGIO enumeration that limit the count to certain types of items. /// The number of items (files and folders) displayed in the folder view. int ItemCount(SVGIO uFlags); /// Gets the address of an enumeration object based on the collection of items in the folder view. /// _SVGIO values that limit the enumeration to certain types of items. /// Reference to the desired IID to represent the folder. /// When this method returns, contains the interface pointer requested in . This is typically an IEnumIDList, IDataObject, or IShellItemArray. If an error occurs, this value is NULL. void Items(SVGIO uFlags, in Guid riid, [MarshalAs(UnmanagedType.IUnknown)] out object ppv); /// Gets the index of an item in the folder's view which has been marked by using the SVSI_SELECTIONMARK in IFolderView::SelectItem. /// The index of the marked item. int GetSelectionMarkedItem(); /// Gets the index of the item that currently has focus in the folder's view. /// The index of the item. int GetFocusedItem(); /// Gets the position of an item in the folder's view. /// A pointer to an ITEMIDLIST interface. /// The position of the item's upper-left corner. Point GetItemPosition([In] PIDL pidl); /// Gets a POINT structure containing the width (x) and height (y) dimensions, including the surrounding white space, of an item. /// The current sizing dimensions of the items in the folder's view. Point GetSpacing(); /// Gets a pointer to a POINT structure containing the default width (x) and height (y) measurements of an item, including the surrounding white space. /// The default sizing dimensions of the items in the folder's view. Point GetDefaultSpacing(); /// Gets the current state of the folder's Auto Arrange mode. /// Returns S_OK if the folder is in Auto Arrange mode; S_FALSE if it is not. [PreserveSig] HRESULT GetAutoArrange(); /// Selects an item in the folder's view. /// The index of the item to select in the folder's view. /// One of the _SVSIF constants that specify the type of selection to apply. void SelectItem(int iItem, SVSIF dwFlags); /// Allows the selection and positioning of items visible in the folder's view. /// The number of items to select. /// A pointer to an array of size that contains the PIDLs of the items. /// A pointer to an array of structures containing the locations each corresponding element in should be positioned. /// One of the _SVSIF constants that specifies the type of selection to apply. void SelectAndPositionItems(uint cidl, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] PIDL[] apidl, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Point[] apt, SVSIF dwFlags); } /// /// Exposes methods that retrieve information about a folder's display options, select specified items in that folder, and set the folder's view mode. /// /// [ComImport, Guid("1af3a467-214f-4298-908e-06b03e0b39f9"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] [PInvokeData("Shobjidl.h", MSDNShortId = "bb761848")] public interface IFolderView2 : IFolderView { /// Gets an address containing a value representing the folder's current view mode. /// The folder's current view mode. new FOLDERVIEWMODE GetCurrentViewMode(); /// Sets the selected folder's view mode. /// One of the following values from the FOLDERVIEWMODE enumeration. new void SetCurrentViewMode(FOLDERVIEWMODE ViewMode); /// Gets the folder object. /// Reference to the desired IID to represent the folder. /// When this method returns, contains the interface pointer requested in . This is typically IShellFolder or a related interface. This can also be an IShellItemArray with a single element. new void GetFolder(in Guid riid, [MarshalAs(UnmanagedType.IUnknown)] out object ppv); /// Gets the identifier of a specific item in the folder view, by index. /// The index of the item in the view. /// The address of a pointer to a PIDL containing the item's identifier information. new void Item(int iItemIndex, out PIDL ppidl); /// Gets the number of items in the folder. This can be the number of all items, or a subset such as the number of selected items. /// Flags from the _SVGIO enumeration that limit the count to certain types of items. /// The number of items (files and folders) displayed in the folder view. new int ItemCount(SVGIO uFlags); /// Gets the address of an enumeration object based on the collection of items in the folder view. /// _SVGIO values that limit the enumeration to certain types of items. /// Reference to the desired IID to represent the folder. /// When this method returns, contains the interface pointer requested in . This is typically an IEnumIDList, IDataObject, or IShellItemArray. If an error occurs, this value is NULL. new void Items(SVGIO uFlags, in Guid riid, [MarshalAs(UnmanagedType.IUnknown)] out object ppv); /// Gets the index of an item in the folder's view which has been marked by using the SVSI_SELECTIONMARK in IFolderView::SelectItem. /// The index of the marked item. new int GetSelectionMarkedItem(); /// Gets the index of the item that currently has focus in the folder's view. /// The index of the item. new int GetFocusedItem(); /// Gets the position of an item in the folder's view. /// A pointer to an ITEMIDLIST interface. /// The position of the item's upper-left corner. new Point GetItemPosition([In] PIDL pidl); /// Gets a POINT structure containing the width (x) and height (y) dimensions, including the surrounding white space, of an item. /// The current sizing dimensions of the items in the folder's view. new Point GetSpacing(); /// Gets a pointer to a POINT structure containing the default width (x) and height (y) measurements of an item, including the surrounding white space. /// The default sizing dimensions of the items in the folder's view. new Point GetDefaultSpacing(); /// Gets the current state of the folder's Auto Arrange mode. /// Returns S_OK if the folder is in Auto Arrange mode; S_FALSE if it is not. [PreserveSig] new HRESULT GetAutoArrange(); /// Selects an item in the folder's view. /// The index of the item to select in the folder's view. /// One of the _SVSIF constants that specify the type of selection to apply. new void SelectItem(int iItem, SVSIF dwFlags); /// Allows the selection and positioning of items visible in the folder's view. /// The number of items to select. /// A pointer to an array of size that contains the PIDLs of the items. /// A pointer to an array of structures containing the locations each corresponding element in should be positioned. /// One of the _SVSIF constants that specifies the type of selection to apply. new void SelectAndPositionItems(uint cidl, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] PIDL[] apidl, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Point[] apt, SVSIF dwFlags); /// Groups the view by the given property key and direction. /// Type: REFPROPERTYKEY /// A PROPERTYKEY by which the view should be grouped. /// Type: BOOL /// A value of type BOOL to indicate sort order of the groups. // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setgroupby // HRESULT SetGroupBy( REFPROPERTYKEY key, BOOL fAscending ); void SetGroupBy(in PROPERTYKEY key, [MarshalAs(UnmanagedType.Bool)] bool fAscending); /// Retrieves the property and sort order used for grouping items in the folder display. /// Type: PROPERTYKEY* /// A pointer to the PROPERTYKEY by which the view is grouped. /// Type: BOOL* /// A pointer to a value of type BOOL that indicates sort order of the groups. // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getgroupby // HRESULT GetGroupBy( PROPERTYKEY *pkey, BOOL *pfAscending ); void GetGroupBy(out PROPERTYKEY pkey, [MarshalAs(UnmanagedType.Bool)] out bool pfAscending); /// Retrieves the property and sort order used for grouping items in the folder display. /// Type: PROPERTYKEY* /// A pointer to the PROPERTYKEY by which the view is grouped. /// Type: BOOL* /// A pointer to a value of type BOOL that indicates sort order of the groups. void RemoteGetGroupBy(out PROPERTYKEY pkey, [MarshalAs(UnmanagedType.Bool)] out bool pfAscending); /// /// [This method is still implemented, but should be considered deprecated as of Windows 7. It might not be implemented in future versions of Windows. It cannot be used with items in search results or library views, so consider using the item's existing properties or, if applicable, emitting properties from your namespace or property handler. See Developing Property Handlers for Windows Search for more information.]Caches a property for an item in the view's property cache. /// /// Type: PCUITEMID_CHILDA PIDL that identifies the item. /// Type: REFPROPERTYKEYThe PROPERTYKEY which is to be stored. /// Type: const PROPVARIANT*A pointer to a PROPVARIANT structure in which the PROPERTYKEY is stored. /// The property is displayed in the view, but not written to the underlying item. // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setviewproperty // DEPRECATED_HRESULT SetViewProperty( PCUITEMID_CHILD pidl, REFPROPERTYKEY propkey, REFPROPVARIANT propvar ); [Obsolete] void SetViewProperty([In] PIDL pidl, in PROPERTYKEY propkey, [In] PROPVARIANT propvar); /// /// [This method is still implemented, but should be considered deprecated as of Windows 7. It might not be implemented in future versions of Windows. It cannot be used with items in search results or library views, so consider using the item's existing properties or, if applicable, emitting properties from your namespace or property handler. See Developing Property Handlers for Windows Search for more information.]Gets a property value for a given property key from the view's cache. /// /// Type: PCUITEMID_CHILDA pointer to an item identifier list (PIDL). /// Type: REFPROPERTYKEYThe PROPERTYKEY to be retrieved. /// Type: PROPVARIANT*A pointer to a PROPVARIANT structure in which the PROPERTYKEY is stored. // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getviewproperty // DEPRECATED_HRESULT GetViewProperty( PCUITEMID_CHILD pidl, REFPROPERTYKEY propkey, PROPVARIANT *ppropvar ); [Obsolete] void GetViewProperty([In] PIDL pidl, in PROPERTYKEY propkey, [In, Out] PROPVARIANT ppropvar); /// /// [This method is still implemented, but should be considered deprecated as of Windows 7. It might not be implemented in future versions of Windows. It cannot be used with items in search results or library views, so consider using the item's existing properties or, if applicable, emitting properties from your namespace or property handler. See Developing Property Handlers for Windows Search for more information.]Set the list of tile properties for an item. /// /// Type: PCUITEMID_CHILDA pointer to an item identifier list (PIDL). /// Type: LPCWSTRA pointer to a Unicode string containing a list of properties. /// /// The pszPropList parameter must be of the form "prop:<canonical-property-name>;<canonical-property-name>" where "<canonical-property-name>" is replaced by an actual canonical property name. The parameter can contain one or more properties delimited by semicolons. /// // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-settileviewproperties // DEPRECATED_HRESULT SetTileViewProperties( PCUITEMID_CHILD pidl, LPCWSTR pszPropList ); [Obsolete] void SetTileViewProperties([In] PIDL pidl, [MarshalAs(UnmanagedType.LPWStr)] string pszPropList); /// /// [This method is still implemented, but should be considered deprecated as of Windows 7. It might not be implemented in future versions of Windows. It cannot be used with items in search results or library views, so consider using the item's existing properties or, if applicable, emitting properties from your namespace or property handler. See Developing Property Handlers for Windows Search for more information.]Sets the list of extended tile properties for an item. /// /// Type: PCUITEMID_CHILDA pointer to an item identifier list (PIDL). /// Type: LPCWSTRA pointer to a Unicode string containing a list of properties. /// /// The pszPropList parameter must be of the form "prop:<canonical-property-name>;<canonical-property-name>" where "<canonical-property-name>" is an actual canonical property name. It can contain one or more properties delimited by semicolons. /// // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setextendedtileviewproperties // DEPRECATED_HRESULT SetExtendedTileViewProperties( PCUITEMID_CHILD pidl, LPCWSTR pszPropList ); [Obsolete] void SetExtendedTileViewProperties([In] PIDL pidl, [MarshalAs(UnmanagedType.LPWStr)] string pszPropList); /// Sets the default text to be used when there are no items in the view. /// Type: FVTEXTTYPEThis value should be set to the following flag.FVST_EMPTYTEXTSet the text to display when there are no items in the view. /// Type: LPCWSTRA pointer to a Unicode string that contains the text to be used. // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-settext // HRESULT SetText( FVTEXTTYPE iType, LPCWSTR pwszText ); void SetText(FVTEXTTYPE iType, [MarshalAs(UnmanagedType.LPWStr)] string pwszText); /// Sets and applies specified folder flags. /// Type: DWORDThe value of type DWORD that specifies the bitmask indicating which items in the structure are desired or valid. /// Type: DWORDThe value of type DWORD that contains one or more FOLDERFLAGS. /// /// For Windows 7 or later: This method must be used in combination with the FVO_CUSTOMPOSITION flag from the FOLDERVIEWOPTIONS enumeration. /// // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setcurrentfolderflags // HRESULT SetCurrentFolderFlags( DWORD dwMask, DWORD dwFlags ); void SetCurrentFolderFlags(FOLDERFLAGS dwMask, FOLDERFLAGS dwFlags); /// Gets the currently applied folder flags. /// /// Type: DWORD* /// A pointer to a DWORD with any FOLDERFLAGS that have been applied to the folder. /// // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getcurrentfolderflags // HRESULT GetCurrentFolderFlags( DWORD *pdwFlags ); FOLDERFLAGS GetCurrentFolderFlags(); /// Gets the count of sort columns currently applied to the view. /// /// Type: int* /// A pointer to an int. /// /// /// Returns E_INVALIDARG if the column count provided does not equal the count of sort columns in the view. /// // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getsortcolumncount // HRESULT GetSortColumnCount( int *pcColumns ); int GetSortColumnCount(); /// Sets and sorts the view by the given sort columns. /// Type: const SORTCOLUMN*A pointer to a SORTCOLUMN structure. The size of this structure is determined by cColumns. /// Type: intThe count of columns to sort by. // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setsortcolumns // HRESULT SetSortColumns( const SORTCOLUMN *rgSortColumns, int cColumns ); void SetSortColumns([In] SORTCOLUMN[] rgSortColumns, int cColumns); /// Gets the sort columns currently applied to the view. /// Type: const SORTCOLUMN*A pointer to a SORTCOLUMN structure. The size of this structure is determined by cColumns. /// Type: intThe count of columns to sort by. // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getsortcolumns // HRESULT GetSortColumns( SORTCOLUMN *rgSortColumns, int cColumns ); void GetSortColumns([In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] SORTCOLUMN[] rgSortColumns, int cColumns); /// Retrieves an object that represents a specified item. /// Type: intThe zero-based index of the item to retrieve. /// Type: REFIIDReference to the desired IID to represent the item, such as IID_IShellItem. /// Type: void**When this method returns, contains the interface pointer requested in . This is typically IShellItem. // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getitem // HRESULT GetItem( int iItem, REFIID riid, void **ppv ); void GetItem(int iItem, in Guid riid, [MarshalAs(UnmanagedType.IUnknown)] out object ppv); /// Gets the next visible item in relation to a given index in the view. /// Type: int /// The zero-based position at which to start searching for a visible item. /// Type: BOOL /// /// TRUE to find the first visible item before iStart. FALSE to find the first visible item after iStart. /// Type: int* /// When this method returns, contains a pointer to a value that receives the index of the visible item in the view. /// /// Type: HRESULT /// This method can return one of these values. /// /// /// Return code /// Description /// /// /// S_OK /// Item retrieved. /// /// /// S_FALSE /// Item not found. Note that this is a success code. /// /// /// // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getvisibleitem // HRESULT GetVisibleItem( int iStart, BOOL fPrevious, int *piItem ); [PreserveSig] HRESULT GetVisibleItem(int iStart, [MarshalAs(UnmanagedType.Bool)] bool fPrevious, out int piItem); /// Locates the currently selected item at or after a given index. /// The index position from which to start searching for the currently selected item. /// A pointer to a value that receives the index of the item in the view. /// /// Type: HRESULT /// Returns S_OK if a selected item was found, or an error value otherwise, including the following: /// /// /// Return code /// Description /// /// /// S_FALSE /// Item not found. Note that this is a success code. The operation was successful in searching the view, it simply did not find a currently selected item after the given index (iStart). It is possible that no item was selected, or that the selected item had an index less than iStart. /// /// /// [PreserveSig] HRESULT GetSelectedItem(int iStart, out int piItem); /// /// Gets the current selection as an IShellItemArray. /// /// /// Type: BOOL /// If TRUE, this method returns an IShellItemArray containing the parent folder when there is no current selection. /// /// /// Type: IShellItemArray** /// The address of a pointer to an IShellItemArray. /// /// /// Type: HRESULT /// Returns one of the following values, or an error otherwise. /// /// /// Return code /// Description /// /// /// S_OK /// The operation completed successfully. /// /// /// S_FALSE /// The IShellItemArray returned has zero items. /// /// /// // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getselection // HRESULT GetSelection( BOOL fNoneImpliesFolder, IShellItemArray **ppsia ); [PreserveSig] HRESULT GetSelection([MarshalAs(UnmanagedType.Bool)] bool fNoneImpliesFolder, out IShellItemArray ppsia); /// Gets the selection state including check state. /// Type: PCUITEMID_CHILD /// A PIDL of the item. /// /// Type: DWORD* /// /// Zero or one of the following _SVSIF constants that specify the current type of selection: SVSI_FOCUSED, /// SVSI_SELECT, SVSI_CHECK, or SVSI_CHECK2. Other _SVSIF constants are not returned by this API. /// /// // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getselectionstate // HRESULT GetSelectionState( PCUITEMID_CHILD pidl, DWORD *pdwFlags ); SVSIF GetSelectionState([In] PIDL pidl); /// Invokes the given verb on the current selection. /// Type: LPCSTRA pointer to a Unicode string containing a verb. /// If pszVerb is NULL, then the default verb is invoked on the selection. // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-invokeverbonselection // HRESULT InvokeVerbOnSelection( LPCSTR pszVerb ); void InvokeVerbOnSelection([MarshalAs(UnmanagedType.LPWStr)] string pszVerb); /// Sets and applies the view mode and image size. /// Type: FOLDERVIEWMODEThe FOLDERVIEWMODE to be applied. /// Type: intThe size of the image in pixels. /// If iImageSize is -1 then the current default icon size for the view mode is used. // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setviewmodeandiconsize // HRESULT SetViewModeAndIconSize( FOLDERVIEWMODE uViewMode, int iImageSize ); void SetViewModeAndIconSize(FOLDERVIEWMODE uViewMode, int iImageSize); /// Gets the current view mode and icon size applied to the view. /// Type: FOLDERVIEWMODE*A pointer to the current FOLDERVIEWMODE. /// Type: int*A pointer to the size of the icon in pixels. // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getviewmodeandiconsize // HRESULT GetViewModeAndIconSize( FOLDERVIEWMODE *puViewMode, int *piImageSize ); void GetViewModeAndIconSize(out FOLDERVIEWMODE puViewMode, out int piImageSize); /// Turns on group subsetting and sets the number of visible rows of items in each group. /// Type: UINTThe number of rows to be visible. /// If cVisibleRows is zero, subsetting is turned off. // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setgroupsubsetcount // HRESULT SetGroupSubsetCount( UINT cVisibleRows ); void SetGroupSubsetCount(uint cVisibleRows); /// Gets the count of visible rows displayed for a group's subset. /// /// Type: UINT* /// The number of rows currently visible. /// /// If group subsetting is disabled the number of rows is zero. // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getgroupsubsetcount // HRESULT GetGroupSubsetCount( UINT *pcVisibleRows ); uint GetGroupSubsetCount(); /// Sets redraw on and off. /// Type: BOOLa BOOL value. // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setredraw // HRESULT SetRedraw( BOOL fRedrawOn ); void SetRedraw([MarshalAs(UnmanagedType.Bool)] bool fRedrawOn); /// /// Checks to see if this view sourced the current drag-and-drop or cut-and-paste operation (used by drop target objects). /// /// /// Type: HRESULTIf this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. /// // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-ismoveinsamefolder // HRESULT IsMoveInSameFolder( ); [PreserveSig] HRESULT IsMoveInSameFolder(); /// Starts a rename operation on the current selection. // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-dorename // HRESULT DoRename( ); void DoRename(); } /// Stores information about how to sort a column that is displayed in the folder view. /// /// Each column displayed in the folder view (for example, "details" view mode), is associated with a property that has a PROPERTYKEY ID. When you want to sort the view by a particular property, you specify the property key for that property. /// // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/ns-shobjidl_core-sortcolumn // typedef struct SORTCOLUMN { PROPERTYKEY propkey; SORTDIRECTION direction; } SORTCOLUMN; [PInvokeData("shobjidl_core.h", MSDNShortId = "3ca4c318-6462-4e22-813c-ef7b3ef03230")] [StructLayout(LayoutKind.Sequential)] public struct SORTCOLUMN { /// Type: PROPERTYKEYThe ID of the column by which the user will sort. A PROPERTYKEY structure. For example, for the "Name" column, the property key is PKEY_ItemNameDisplay. public PROPERTYKEY propkey; /// Type: SORTDIRECTIONThe direction in which the items are sorted. One of the following values.SORT_DESCENDINGThe items are sorted in ascending order. Whether the sort is alphabetical, numerical, and so on, is determined by the data type of the column indicated in propkey.SORT_ASCENDINGThe items are sorted in descending order. Whether the sort is alphabetical, numerical, and so on, is determined by the data type of the column indicated in propkey. public SORTDIRECTION direction; } /// /// The direction in which the items are sorted. /// [PInvokeData("shobjidl_core.h", MSDNShortId = "3ca4c318-6462-4e22-813c-ef7b3ef03230")] public enum SORTDIRECTION { /// The items are sorted in ascending order. Whether the sort is alphabetical, numerical, and so on, is determined by the data type of the column indicated in . SORT_DESCENDING = -1, /// The items are sorted in descending order. Whether the sort is alphabetical, numerical, and so on, is determined by the data type of the column indicated in . SORT_ASCENDING = 1 } } }