Fixed problems with some Shell interfaces

pull/30/head
David Hall 2019-01-11 18:05:27 -07:00
parent 2527cda0d9
commit 2da25331d2
6 changed files with 209 additions and 78 deletions

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Text; using System.Text;
@ -94,6 +95,9 @@ namespace Vanara.PInvoke
HRESULT IncludeObject([In] IShellView ppshv, [In] PIDL pidl); HRESULT IncludeObject([In] IShellView ppshv, [In] PIDL pidl);
} }
/*
* ICommDlgBrowser2 causes grief in .NET for some reason, so it is being left out.
*
/// <summary> /// <summary>
/// Extends the capabilities of ICommDlgBrowser. This interface is exposed by the common file dialog boxes when they host a Shell /// Extends the capabilities of ICommDlgBrowser. This interface is exposed by the common file dialog boxes when they host a Shell
/// browser. A pointer to ICommDlgBrowser2 can be obtained by calling QueryInterface on the IShellBrowser object. /// browser. A pointer to ICommDlgBrowser2 can be obtained by calling QueryInterface on the IShellBrowser object.
@ -151,39 +155,33 @@ namespace Vanara.PInvoke
[PreserveSig] [PreserveSig]
HRESULT GetViewFlags(out CDB2GVF pdwFlags); HRESULT GetViewFlags(out CDB2GVF pdwFlags);
} }
*/
/// <summary>Extends the capabilities of ICommDlgBrowser2, and used by the common file dialog boxes when they host a Shell browser.</summary> /// <summary>Extends the capabilities of ICommDlgBrowser2, and used by the common file dialog boxes when they host a Shell browser.</summary>
/// <seealso cref="Vanara.PInvoke.Shell32.ICommDlgBrowser"/> /// <seealso cref="Vanara.PInvoke.Shell32.ICommDlgBrowser"/>
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("c8ad25a1-3294-41ee-8165-71174bd01c57")] [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("c8ad25a1-3294-41ee-8165-71174bd01c57")]
[PInvokeData("Shobjidl.h", MSDNShortId = "c9286061-8ac8-452b-9204-193bc6b571cb")] [PInvokeData("Shobjidl.h", MSDNShortId = "c9286061-8ac8-452b-9204-193bc6b571cb")]
public interface ICommDlgBrowser3 : ICommDlgBrowser public interface ICommDlgBrowser3 //: ICommDlgBrowser // Don't derive as it seems to cause problems with memory allocations.
{ {
/// <summary>Called when a user double-clicks in the view or presses the ENTER key.</summary> /// <summary>Called when a user double-clicks in the view or presses the ENTER key.</summary>
/// <param name="ppshv">A pointer to the view's IShellView interface.</param> /// <param name="ppshv">A pointer to the view's IShellView interface.</param>
/// <returns>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</returns> /// <returns>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</returns>
[PreserveSig] [PreserveSig]
new HRESULT OnDefaultCommand([In] IShellView ppshv); HRESULT OnDefaultCommand([In] IShellView ppshv);
/// <summary>Called after a state, identified by the uChange parameter, has changed in the IShellView interface.</summary> /// <summary>Called after a state, identified by the uChange parameter, has changed in the IShellView interface.</summary>
/// <param name="ppshv">A pointer to the view's IShellView interface.</param> /// <param name="ppshv">A pointer to the view's IShellView interface.</param>
/// <param name="uChange">Change in the selection state. This parameter can be one of the following values.</param> /// <param name="uChange">Change in the selection state. This parameter can be one of the following values.</param>
/// <returns>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</returns> /// <returns>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</returns>
[PreserveSig] [PreserveSig]
new HRESULT OnStateChange([In] IShellView ppshv, CDBOSC uChange); HRESULT OnStateChange([In] IShellView ppshv, CDBOSC uChange);
/// <summary>Allows the common dialog box to filter objects that the view displays.</summary> /// <summary>Allows the common dialog box to filter objects that the view displays.</summary>
/// <param name="ppshv">A pointer to the view's IShellView interface.</param> /// <param name="ppshv">A pointer to the view's IShellView interface.</param>
/// <param name="pidl">A PIDL, relative to the folder, that identifies the object.</param> /// <param name="pidl">A PIDL, relative to the folder, that identifies the object.</param>
/// <returns>The browser should return S_OK to include the object in the view, or S_FALSE to hide it.</returns> /// <returns>The browser should return S_OK to include the object in the view, or S_FALSE to hide it.</returns>
[PreserveSig] [PreserveSig]
new HRESULT IncludeObject([In] IShellView ppshv, [In] PIDL pidl); HRESULT IncludeObject([In] IShellView ppshv, [In] IntPtr pidl);
/// <summary>Called by a Shell view to notify the common dialog box hosting it that an event has occurred.</summary>
/// <param name="ppshv">A pointer to the view's IShellView interface.</param>
/// <param name="dwNotifyType">A flag that can can take one of the following two values.</param>
/// <returns>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</returns>
[PreserveSig]
HRESULT Notify([In] IShellView ppshv, CDB2N dwNotifyType);
/// <summary>Called by the Shell view to get the default shortcut menu text.</summary> /// <summary>Called by the Shell view to get the default shortcut menu text.</summary>
/// <param name="ppshv">A pointer to the view's IShellView interface.</param> /// <param name="ppshv">A pointer to the view's IShellView interface.</param>
@ -206,12 +204,12 @@ namespace Vanara.PInvoke
[PreserveSig] [PreserveSig]
HRESULT GetViewFlags(out CDB2GVF pdwFlags); HRESULT GetViewFlags(out CDB2GVF pdwFlags);
/// <summary>Called after a specified column is clicked in the IShellView interface.</summary> /// <summary>Called by a Shell view to notify the common dialog box hosting it that an event has occurred.</summary>
/// <param name="ppshv">A pointer to the IShellView interface of the hosted view.</param> /// <param name="ppshv">A pointer to the view's IShellView interface.</param>
/// <param name="iColumn">The index of the column clicked.</param> /// <param name="dwNotifyType">A flag that can can take one of the following two values.</param>
/// <returns>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</returns> /// <returns>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</returns>
[PreserveSig] [PreserveSig]
HRESULT OnColumnClicked([In] IShellView ppshv, int iColumn); HRESULT Notify([In] IShellView ppshv, CDB2N dwNotifyType);
/// <summary>Gets the current filter as a Unicode string.</summary> /// <summary>Gets the current filter as a Unicode string.</summary>
/// <param name="pszFileSpec">Contains a pointer to the current filter path/file as a Unicode string.</param> /// <param name="pszFileSpec">Contains a pointer to the current filter path/file as a Unicode string.</param>
@ -220,11 +218,75 @@ namespace Vanara.PInvoke
[PreserveSig] [PreserveSig]
HRESULT GetCurrentFilter([MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFileSpec, int cchFileSpec); HRESULT GetCurrentFilter([MarshalAs(UnmanagedType.LPWStr)] StringBuilder pszFileSpec, int cchFileSpec);
/// <summary>Called after a specified column is clicked in the IShellView interface.</summary>
/// <param name="ppshv">A pointer to the IShellView interface of the hosted view.</param>
/// <param name="iColumn">The index of the column clicked.</param>
/// <returns>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</returns>
[PreserveSig]
HRESULT OnColumnClicked([In] IShellView ppshv, int iColumn);
/// <summary>Called after a specified preview is created in the IShellView interface.</summary> /// <summary>Called after a specified preview is created in the IShellView interface.</summary>
/// <param name="ppshv">A pointer to the IShellView interface of the hosted view.</param> /// <param name="ppshv">A pointer to the IShellView interface of the hosted view.</param>
/// <returns>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</returns> /// <returns>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</returns>
[PreserveSig] [PreserveSig]
HRESULT OnPreViewCreated([In] IShellView ppshv); HRESULT OnPreViewCreated([In] IShellView ppshv);
} }
/*[ComImport, Guid("c8ad25a1-3294-41ee-8165-71174bd01c57"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
public interface ICommDlgBrowser3
{
// dlg1
[PreserveSig]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
HRESULT OnDefaultCommand(IntPtr ppshv);
[PreserveSig]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
HRESULT OnStateChange(
IntPtr ppshv,
CDBOSC uChange);
[PreserveSig]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
HRESULT IncludeObject(
IntPtr ppshv,
IntPtr pidl);
// dlg2
[PreserveSig]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
HRESULT GetDefaultMenuText(
IShellView shellView,
IntPtr buffer, //A pointer to a buffer that is used by the Shell browser to return the default shortcut menu text.
int bufferMaxLength); //should be max size = 260?
[PreserveSig]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
HRESULT GetViewFlags(
[Out] out CDB2GVF pdwFlags); // CommDlgBrowser2ViewFlags
[PreserveSig]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
HRESULT Notify(
IntPtr pshv, CDB2N notifyType);
// dlg3
[PreserveSig]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
HRESULT GetCurrentFilter(
StringBuilder pszFileSpec,
int cchFileSpec);
[PreserveSig]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
HRESULT OnColumnClicked(
IShellView ppshv,
int iColumn);
[PreserveSig]
[MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)]
HRESULT OnPreViewCreated(IShellView ppshv);
}*/
} }
} }

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Vanara.PInvoke namespace Vanara.PInvoke
@ -155,7 +156,7 @@ namespace Vanara.PInvoke
/// </remarks> /// </remarks>
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nn-shobjidl_core-iexplorerbrowser // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nn-shobjidl_core-iexplorerbrowser
[PInvokeData("shobjidl_core.h", MSDNShortId = "da2cf5d4-5a68-4d18-807b-b9d4e2712c10")] [PInvokeData("shobjidl_core.h", MSDNShortId = "da2cf5d4-5a68-4d18-807b-b9d4e2712c10")]
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("dfd3b6b5-c10c-4be9-85f6-a66969f402f6"), CoClass(typeof(ExplorerBrowser))] [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("DFD3B6B5-C10C-4BE9-85F6-A66969F402F6"), CoClass(typeof(ExplorerBrowser))]
public interface IExplorerBrowser public interface IExplorerBrowser
{ {
/// <summary>Prepares the browser to be navigated.</summary> /// <summary>Prepares the browser to be navigated.</summary>
@ -173,7 +174,7 @@ namespace Vanara.PInvoke
/// <summary>Sets the size and position of the view windows created by the browser.</summary> /// <summary>Sets the size and position of the view windows created by the browser.</summary>
/// <param name="phdwp">A pointer to a DeferWindowPos handle. This parameter can be NULL.</param> /// <param name="phdwp">A pointer to a DeferWindowPos handle. This parameter can be NULL.</param>
/// <param name="rcBrowser">The coordinates that the browser will occupy.</param> /// <param name="rcBrowser">The coordinates that the browser will occupy.</param>
void SetRect(IntPtr phdwp, RECT rcBrowser); void SetRect([In, Out] ref HDWP phdwp, [In] RECT rcBrowser);
/// <summary>Sets the name of the property bag.</summary> /// <summary>Sets the name of the property bag.</summary>
/// <param name="pszPropertyBag"> /// <param name="pszPropertyBag">
@ -218,7 +219,7 @@ namespace Vanara.PInvoke
/// This parameter can be NULL. For more information, see Remarks. /// This parameter can be NULL. For more information, see Remarks.
/// </param> /// </param>
/// <param name="uFlags">A flag that specifies the category of the pidl. This affects how navigation is accomplished.</param> /// <param name="uFlags">A flag that specifies the category of the pidl. This affects how navigation is accomplished.</param>
void BrowseToIDList([In] PIDL pidl, [In] SBSP uFlags); void BrowseToIDList([In] IntPtr pidl, [In] SBSP uFlags);
/// <summary>Browses to an object.</summary> /// <summary>Browses to an object.</summary>
/// <param name="punk">A pointer to an object to browse to. If the object cannot be browsed, an error value is returned.</param> /// <param name="punk">A pointer to an object to browse to. If the object cannot be browsed, an error value is returned.</param>
@ -247,27 +248,91 @@ namespace Vanara.PInvoke
} }
/// <summary>Exposes methods for notification of Explorer browser navigation and view creation events.</summary> /// <summary>Exposes methods for notification of Explorer browser navigation and view creation events.</summary>
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("361bbdc7-e6ee-4e13-be58-58e2240c810f"), CoClass(typeof(ExplorerBrowser))] [ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("361bbdc7-e6ee-4e13-be58-58e2240c810f")]
[PInvokeData("Shobjidl.h", MSDNShortId = "802d547f-41c2-4c4a-9f07-be615d7b86eb")] [PInvokeData("Shobjidl.h", MSDNShortId = "802d547f-41c2-4c4a-9f07-be615d7b86eb")]
public interface IExplorerBrowserEvents public interface IExplorerBrowserEvents
{ {
/// <summary>Notifies clients of a pending Explorer browser navigation to a Shell folder.</summary> /// <summary>Notifies clients of a pending Explorer browser navigation to a Shell folder.</summary>
/// <param name="pidlFolder">A PIDL that specifies the folder.</param> /// <param name="pidlFolder">
/// <para>Type: <c>PCIDLIST_ABSOLUTE</c></para>
/// <para>A PIDL that specifies the folder.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>
/// <para>
/// Explorer browser calls this method before it navigates to a folder, that is, before calling
/// IExplorerBrowserEvents::OnNavigationFailed or IExplorerBrowserEvents::OnNavigationComplete.
/// </para>
/// <para>Returning any failure code from this method, including E_NOTIMPL, will cancel the navigation.</para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-iexplorerbrowserevents-onnavigationpending
// HRESULT OnNavigationPending( PCIDLIST_ABSOLUTE pidlFolder );
[PreserveSig] [PreserveSig]
HRESULT OnNavigationPending([In] IntPtr pidlFolder); HRESULT OnNavigationPending([In] IntPtr pidlFolder);
/// <summary>Notifies clients that the view of the Explorer browser has been created and can be modified.</summary> /// <summary>Notifies clients that the view of the Explorer browser has been created and can be modified.</summary>
/// <param name="psv">A pointer to an IShellView.</param> /// <param name="psv">
/// <para>Type: <c>IShellView*</c></para>
/// <para>A pointer to an IShellView.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>
/// An Explorer browser calls this method to enable the client to perform any modifications to the Explorer browser view before
/// it is shown; for example, to set view modes or folder flags.
/// </remarks>
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-iexplorerbrowserevents-onviewcreated
// HRESULT OnViewCreated( IShellView *psv );
[PreserveSig] [PreserveSig]
HRESULT OnViewCreated([In] IShellView psv); HRESULT OnViewCreated([In] IShellView psv);
/// <summary>Notifies clients that the Explorer browser has successfully navigated to a Shell folder.</summary> /// <summary>Notifies clients that the Explorer browser has successfully navigated to a Shell folder.</summary>
/// <param name="pidlFolder">A PIDL that specifies the folder.</param> /// <param name="pidlFolder">
/// <para>Type: <c>PCIDLIST_ABSOLUTE</c></para>
/// <para>A PIDL that specifies the folder.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>
/// <para>This method is called after method IExplorerBrowserEvents::OnViewCreated, assuming a successful view creation.</para>
/// <para>
/// After a navigation and view creation, either <c>IExplorerBrowserEvents::OnNavigationComplete</c> or
/// IExplorerBrowserEvents::OnNavigationFailed is called depending on whether the destination could be navigated to. For example,
/// a failure to navigate includes a destination that is not reached either because there is no route to the path or the user has canceled.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-iexplorerbrowserevents-onnavigationcomplete
// HRESULT OnNavigationComplete( PCIDLIST_ABSOLUTE pidlFolder );
[PreserveSig] [PreserveSig]
HRESULT OnNavigationComplete([In] IntPtr pidlFolder); HRESULT OnNavigationComplete([In] IntPtr pidlFolder);
/// <summary>Notifies clients that the Explorer browser has failed to navigate to a Shell folder.</summary> /// <summary>Notifies clients that the Explorer browser has failed to navigate to a Shell folder.</summary>
/// <param name="pidlFolder">A PIDL that specifies the folder.</param> /// <param name="pidlFolder">
/// <para>Type: <c>PCIDLIST_ABSOLUTE</c></para>
/// <para>A PIDL that specifies the folder.</para>
/// </param>
/// <returns>
/// <para>Type: <c>HRESULT</c></para>
/// <para>If this method succeeds, it returns <c>S_OK</c>. Otherwise, it returns an <c>HRESULT</c> error code.</para>
/// </returns>
/// <remarks>
/// <para>This method is called after method IExplorerBrowserEvents::OnViewCreated, assuming a successful view creation.</para>
/// <para>
/// After a navigation and view creation, either IExplorerBrowserEvents::OnNavigationComplete or
/// <c>IExplorerBrowserEvents::OnNavigationFailed</c> is called, depending on whether the destination could be navigated to. For
/// example, a failure to navigate includes a destination that is not reached either because there is no route to the path or the
/// user has canceled.
/// </para>
/// </remarks>
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-iexplorerbrowserevents-onnavigationfailed
// HRESULT OnNavigationFailed( PCIDLIST_ABSOLUTE pidlFolder );
[PreserveSig] [PreserveSig]
HRESULT OnNavigationFailed([In] IntPtr pidlFolder); HRESULT OnNavigationFailed([In] IntPtr pidlFolder);
} }

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Vanara.PInvoke namespace Vanara.PInvoke
@ -101,7 +102,7 @@ namespace Vanara.PInvoke
/// </remarks> /// </remarks>
[PInvokeData("shobjidl_core.h", MSDNShortId = "6c051cdc-b7f9-48dc-ba32-38f0f1ee5fda")] [PInvokeData("shobjidl_core.h", MSDNShortId = "6c051cdc-b7f9-48dc-ba32-38f0f1ee5fda")]
[PreserveSig] [PreserveSig]
HRESULT GetPaneState(in Guid ep, ref EXPLORERPANESTATE peps); HRESULT GetPaneState(in Guid ep, out EXPLORERPANESTATE peps);
} }
/// <summary>Constant GUIDs used by IExplorerPaneVisibility::GetPaneState.</summary> /// <summary>Constant GUIDs used by IExplorerPaneVisibility::GetPaneState.</summary>

View File

@ -237,38 +237,38 @@ namespace Vanara.PInvoke
/// <summary>Sets the selected folder's view mode.</summary> /// <summary>Sets the selected folder's view mode.</summary>
/// <param name="ViewMode">One of the following values from the FOLDERVIEWMODE enumeration.</param> /// <param name="ViewMode">One of the following values from the FOLDERVIEWMODE enumeration.</param>
void SetCurrentViewMode(FOLDERVIEWMODE ViewMode); void SetCurrentViewMode([In] FOLDERVIEWMODE ViewMode);
/// <summary>Gets the folder object.</summary> /// <summary>Gets the folder object.</summary>
/// <param name="riid">Reference to the desired IID to represent the folder.</param> /// <param name="riid">Reference to the desired IID to represent the folder.</param>
/// <param name="ppv"> /// <returns>
/// When this method returns, contains the interface pointer requested in <paramref name="riid"/>. This is typically IShellFolder /// When this method returns, contains the interface pointer requested in <paramref name="riid"/>. This is typically IShellFolder
/// or a related interface. This can also be an IShellItemArray with a single element. /// or a related interface. This can also be an IShellItemArray with a single element.
/// </param> /// </returns>
[return: MarshalAs(UnmanagedType.IUnknown)] [return: MarshalAs(UnmanagedType.IUnknown, IidParameterIndex = 0)]
object GetFolder(in Guid riid); object GetFolder(in Guid riid);
/// <summary>Gets the identifier of a specific item in the folder view, by index.</summary> /// <summary>Gets the identifier of a specific item in the folder view, by index.</summary>
/// <param name="iItemIndex">The index of the item in the view.</param> /// <param name="iItemIndex">The index of the item in the view.</param>
/// <param name="ppidl">The address of a pointer to a PIDL containing the item's identifier information.</param> /// <returns>The address of a pointer to a PIDL containing the item's identifier information.</returns>
PIDL Item(int iItemIndex); IntPtr Item([In] int iItemIndex);
/// <summary> /// <summary>
/// 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. /// 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.
/// </summary> /// </summary>
/// <param name="uFlags">Flags from the _SVGIO enumeration that limit the count to certain types of items.</param> /// <param name="uFlags">Flags from the _SVGIO enumeration that limit the count to certain types of items.</param>
/// <returns>The number of items (files and folders) displayed in the folder view.</returns> /// <returns>The number of items (files and folders) displayed in the folder view.</returns>
int ItemCount(SVGIO uFlags); int ItemCount([In] SVGIO uFlags);
/// <summary>Gets the address of an enumeration object based on the collection of items in the folder view.</summary> /// <summary>Gets the address of an enumeration object based on the collection of items in the folder view.</summary>
/// <param name="uFlags">_SVGIO values that limit the enumeration to certain types of items.</param> /// <param name="uFlags">_SVGIO values that limit the enumeration to certain types of items.</param>
/// <param name="riid">Reference to the desired IID to represent the folder.</param> /// <param name="riid">Reference to the desired IID to represent the folder.</param>
/// <param name="ppv"> /// <returns>
/// When this method returns, contains the interface pointer requested in <paramref name="riid"/>. This is typically an /// When this method returns, contains the interface pointer requested in <paramref name="riid"/>. This is typically an
/// IEnumIDList, IDataObject, or IShellItemArray. If an error occurs, this value is NULL. /// IEnumIDList, IDataObject, or IShellItemArray. If an error occurs, this value is NULL.
/// </param> /// </returns>
[return: MarshalAs(UnmanagedType.IUnknown)] [return: MarshalAs(UnmanagedType.IUnknown, IidParameterIndex = 1)]
object Items(SVGIO uFlags, in Guid riid); object Items([In] SVGIO uFlags, in Guid riid);
/// <summary>Gets the index of an item in the folder's view which has been marked by using the SVSI_SELECTIONMARK in IFolderView::SelectItem.</summary> /// <summary>Gets the index of an item in the folder's view which has been marked by using the SVSI_SELECTIONMARK in IFolderView::SelectItem.</summary>
/// <returns>The index of the marked item.</returns> /// <returns>The index of the marked item.</returns>
@ -281,7 +281,7 @@ namespace Vanara.PInvoke
/// <summary>Gets the position of an item in the folder's view.</summary> /// <summary>Gets the position of an item in the folder's view.</summary>
/// <param name="pidl">A pointer to an ITEMIDLIST interface.</param> /// <param name="pidl">A pointer to an ITEMIDLIST interface.</param>
/// <returns>The position of the item's upper-left corner.</returns> /// <returns>The position of the item's upper-left corner.</returns>
Point GetItemPosition([In] PIDL pidl); Point GetItemPosition([In] IntPtr pidl);
/// <summary> /// <summary>
/// Gets a POINT structure containing the width (x) and height (y) dimensions, including the surrounding white space, of an item. /// Gets a POINT structure containing the width (x) and height (y) dimensions, including the surrounding white space, of an item.
@ -304,7 +304,7 @@ namespace Vanara.PInvoke
/// <summary>Selects an item in the folder's view.</summary> /// <summary>Selects an item in the folder's view.</summary>
/// <param name="iItem">The index of the item to select in the folder's view.</param> /// <param name="iItem">The index of the item to select in the folder's view.</param>
/// <param name="dwFlags">One of the _SVSIF constants that specify the type of selection to apply.</param> /// <param name="dwFlags">One of the _SVSIF constants that specify the type of selection to apply.</param>
void SelectItem(int iItem, SVSIF dwFlags); void SelectItem([In] int iItem, [In] SVSIF dwFlags);
/// <summary>Allows the selection and positioning of items visible in the folder's view.</summary> /// <summary>Allows the selection and positioning of items visible in the folder's view.</summary>
/// <param name="cidl">The number of items to select.</param> /// <param name="cidl">The number of items to select.</param>
@ -314,7 +314,7 @@ namespace Vanara.PInvoke
/// name="apidl"/> should be positioned. /// name="apidl"/> should be positioned.
/// </param> /// </param>
/// <param name="dwFlags">One of the _SVSIF constants that specifies the type of selection to apply.</param> /// <param name="dwFlags">One of the _SVSIF constants that specifies the type of selection to apply.</param>
void SelectAndPositionItems(uint cidl, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] PIDL[] apidl, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Point[] apt, SVSIF dwFlags); void SelectAndPositionItems([In] uint cidl, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] IntPtr[] apidl, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Point[] apt, [In] SVSIF dwFlags);
} }
/// <summary> /// <summary>
@ -332,38 +332,38 @@ namespace Vanara.PInvoke
/// <summary>Sets the selected folder's view mode.</summary> /// <summary>Sets the selected folder's view mode.</summary>
/// <param name="ViewMode">One of the following values from the FOLDERVIEWMODE enumeration.</param> /// <param name="ViewMode">One of the following values from the FOLDERVIEWMODE enumeration.</param>
new void SetCurrentViewMode(FOLDERVIEWMODE ViewMode); new void SetCurrentViewMode([In] FOLDERVIEWMODE ViewMode);
/// <summary>Gets the folder object.</summary> /// <summary>Gets the folder object.</summary>
/// <param name="riid">Reference to the desired IID to represent the folder.</param> /// <param name="riid">Reference to the desired IID to represent the folder.</param>
/// <param name="ppv"> /// <returns>
/// When this method returns, contains the interface pointer requested in <paramref name="riid"/>. This is typically IShellFolder /// When this method returns, contains the interface pointer requested in <paramref name="riid"/>. This is typically IShellFolder
/// or a related interface. This can also be an IShellItemArray with a single element. /// or a related interface. This can also be an IShellItemArray with a single element.
/// </param> /// </returns>
[return: MarshalAs(UnmanagedType.IUnknown)] [return: MarshalAs(UnmanagedType.IUnknown, IidParameterIndex = 0)]
new object GetFolder(in Guid riid); new object GetFolder(in Guid riid);
/// <summary>Gets the identifier of a specific item in the folder view, by index.</summary> /// <summary>Gets the identifier of a specific item in the folder view, by index.</summary>
/// <param name="iItemIndex">The index of the item in the view.</param> /// <param name="iItemIndex">The index of the item in the view.</param>
/// <param name="ppidl">The address of a pointer to a PIDL containing the item's identifier information.</param> /// <returns>The address of a pointer to a PIDL containing the item's identifier information.</returns>
new PIDL Item(int iItemIndex); new IntPtr Item([In] int iItemIndex);
/// <summary> /// <summary>
/// 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. /// 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.
/// </summary> /// </summary>
/// <param name="uFlags">Flags from the _SVGIO enumeration that limit the count to certain types of items.</param> /// <param name="uFlags">Flags from the _SVGIO enumeration that limit the count to certain types of items.</param>
/// <returns>The number of items (files and folders) displayed in the folder view.</returns> /// <returns>The number of items (files and folders) displayed in the folder view.</returns>
new int ItemCount(SVGIO uFlags); new int ItemCount([In] SVGIO uFlags);
/// <summary>Gets the address of an enumeration object based on the collection of items in the folder view.</summary> /// <summary>Gets the address of an enumeration object based on the collection of items in the folder view.</summary>
/// <param name="uFlags">_SVGIO values that limit the enumeration to certain types of items.</param> /// <param name="uFlags">_SVGIO values that limit the enumeration to certain types of items.</param>
/// <param name="riid">Reference to the desired IID to represent the folder.</param> /// <param name="riid">Reference to the desired IID to represent the folder.</param>
/// <param name="ppv"> /// <returns>
/// When this method returns, contains the interface pointer requested in <paramref name="riid"/>. This is typically an /// When this method returns, contains the interface pointer requested in <paramref name="riid"/>. This is typically an
/// IEnumIDList, IDataObject, or IShellItemArray. If an error occurs, this value is NULL. /// IEnumIDList, IDataObject, or IShellItemArray. If an error occurs, this value is NULL.
/// </param> /// </returns>
[return: MarshalAs(UnmanagedType.IUnknown)] [return: MarshalAs(UnmanagedType.IUnknown, IidParameterIndex = 1)]
new object Items(SVGIO uFlags, in Guid riid); new object Items([In] SVGIO uFlags, in Guid riid);
/// <summary>Gets the index of an item in the folder's view which has been marked by using the SVSI_SELECTIONMARK in IFolderView::SelectItem.</summary> /// <summary>Gets the index of an item in the folder's view which has been marked by using the SVSI_SELECTIONMARK in IFolderView::SelectItem.</summary>
/// <returns>The index of the marked item.</returns> /// <returns>The index of the marked item.</returns>
@ -376,7 +376,7 @@ namespace Vanara.PInvoke
/// <summary>Gets the position of an item in the folder's view.</summary> /// <summary>Gets the position of an item in the folder's view.</summary>
/// <param name="pidl">A pointer to an ITEMIDLIST interface.</param> /// <param name="pidl">A pointer to an ITEMIDLIST interface.</param>
/// <returns>The position of the item's upper-left corner.</returns> /// <returns>The position of the item's upper-left corner.</returns>
new Point GetItemPosition([In] PIDL pidl); new Point GetItemPosition([In] IntPtr pidl);
/// <summary> /// <summary>
/// Gets a POINT structure containing the width (x) and height (y) dimensions, including the surrounding white space, of an item. /// Gets a POINT structure containing the width (x) and height (y) dimensions, including the surrounding white space, of an item.
@ -399,7 +399,7 @@ namespace Vanara.PInvoke
/// <summary>Selects an item in the folder's view.</summary> /// <summary>Selects an item in the folder's view.</summary>
/// <param name="iItem">The index of the item to select in the folder's view.</param> /// <param name="iItem">The index of the item to select in the folder's view.</param>
/// <param name="dwFlags">One of the _SVSIF constants that specify the type of selection to apply.</param> /// <param name="dwFlags">One of the _SVSIF constants that specify the type of selection to apply.</param>
new void SelectItem(int iItem, SVSIF dwFlags); new void SelectItem([In] int iItem, [In] SVSIF dwFlags);
/// <summary>Allows the selection and positioning of items visible in the folder's view.</summary> /// <summary>Allows the selection and positioning of items visible in the folder's view.</summary>
/// <param name="cidl">The number of items to select.</param> /// <param name="cidl">The number of items to select.</param>
@ -409,7 +409,7 @@ namespace Vanara.PInvoke
/// name="apidl"/> should be positioned. /// name="apidl"/> should be positioned.
/// </param> /// </param>
/// <param name="dwFlags">One of the _SVSIF constants that specifies the type of selection to apply.</param> /// <param name="dwFlags">One of the _SVSIF constants that specifies the type of selection to apply.</param>
new void SelectAndPositionItems(uint cidl, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] PIDL[] apidl, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Point[] apt, SVSIF dwFlags); new void SelectAndPositionItems([In] uint cidl, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] IntPtr[] apidl, [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Point[] apt, [In] SVSIF dwFlags);
/// <summary>Groups the view by the given property key and direction.</summary> /// <summary>Groups the view by the given property key and direction.</summary>
/// <param name="key"> /// <param name="key">
@ -462,7 +462,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setviewproperty // 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 ); // DEPRECATED_HRESULT SetViewProperty( PCUITEMID_CHILD pidl, REFPROPERTYKEY propkey, REFPROPVARIANT propvar );
[Obsolete] [Obsolete]
void SetViewProperty([In] PIDL pidl, in PROPERTYKEY propkey, [In] PROPVARIANT propvar); void SetViewProperty([In] IntPtr pidl, in PROPERTYKEY propkey, [In] PROPVARIANT propvar);
/// <summary> /// <summary>
/// <para> /// <para>
@ -488,7 +488,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getviewproperty // 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 ); // DEPRECATED_HRESULT GetViewProperty( PCUITEMID_CHILD pidl, REFPROPERTYKEY propkey, PROPVARIANT *ppropvar );
[Obsolete] [Obsolete]
void GetViewProperty([In] PIDL pidl, in PROPERTYKEY propkey, [In, Out] PROPVARIANT ppropvar); void GetViewProperty([In] IntPtr pidl, in PROPERTYKEY propkey, [In, Out] PROPVARIANT ppropvar);
/// <summary> /// <summary>
/// <para> /// <para>
@ -515,7 +515,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-settileviewproperties // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-settileviewproperties
// DEPRECATED_HRESULT SetTileViewProperties( PCUITEMID_CHILD pidl, LPCWSTR pszPropList ); // DEPRECATED_HRESULT SetTileViewProperties( PCUITEMID_CHILD pidl, LPCWSTR pszPropList );
[Obsolete] [Obsolete]
void SetTileViewProperties([In] PIDL pidl, [MarshalAs(UnmanagedType.LPWStr)] string pszPropList); void SetTileViewProperties([In] IntPtr pidl, [In, MarshalAs(UnmanagedType.LPWStr)] string pszPropList);
/// <summary> /// <summary>
/// <para> /// <para>
@ -541,7 +541,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setextendedtileviewproperties // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setextendedtileviewproperties
// DEPRECATED_HRESULT SetExtendedTileViewProperties( PCUITEMID_CHILD pidl, LPCWSTR pszPropList ); // DEPRECATED_HRESULT SetExtendedTileViewProperties( PCUITEMID_CHILD pidl, LPCWSTR pszPropList );
[Obsolete] [Obsolete]
void SetExtendedTileViewProperties([In] PIDL pidl, [MarshalAs(UnmanagedType.LPWStr)] string pszPropList); void SetExtendedTileViewProperties([In] IntPtr pidl, [In, MarshalAs(UnmanagedType.LPWStr)] string pszPropList);
/// <summary>Sets the default text to be used when there are no items in the view.</summary> /// <summary>Sets the default text to be used when there are no items in the view.</summary>
/// <param name="iType"> /// <param name="iType">
@ -556,7 +556,7 @@ namespace Vanara.PInvoke
/// </param> /// </param>
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-settext HRESULT SetText( // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-settext HRESULT SetText(
// FVTEXTTYPE iType, LPCWSTR pwszText ); // FVTEXTTYPE iType, LPCWSTR pwszText );
void SetText(FVTEXTTYPE iType, [MarshalAs(UnmanagedType.LPWStr)] string pwszText); void SetText([In] FVTEXTTYPE iType, [In, MarshalAs(UnmanagedType.LPWStr)] string pwszText);
/// <summary>Sets and applies specified folder flags.</summary> /// <summary>Sets and applies specified folder flags.</summary>
/// <param name="dwMask"> /// <param name="dwMask">
@ -573,7 +573,7 @@ namespace Vanara.PInvoke
/// </remarks> /// </remarks>
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setcurrentfolderflags HRESULT // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setcurrentfolderflags HRESULT
// SetCurrentFolderFlags( DWORD dwMask, DWORD dwFlags ); // SetCurrentFolderFlags( DWORD dwMask, DWORD dwFlags );
void SetCurrentFolderFlags(FOLDERFLAGS dwMask, FOLDERFLAGS dwFlags); void SetCurrentFolderFlags([In] FOLDERFLAGS dwMask, [In] FOLDERFLAGS dwFlags);
/// <summary>Gets the currently applied folder flags.</summary> /// <summary>Gets the currently applied folder flags.</summary>
/// <returns> /// <returns>
@ -605,7 +605,7 @@ namespace Vanara.PInvoke
/// </param> /// </param>
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setsortcolumns HRESULT // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setsortcolumns HRESULT
// SetSortColumns( const SORTCOLUMN *rgSortColumns, int cColumns ); // SetSortColumns( const SORTCOLUMN *rgSortColumns, int cColumns );
void SetSortColumns([In] SORTCOLUMN[] rgSortColumns, int cColumns); void SetSortColumns([In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] SORTCOLUMN[] rgSortColumns, [In] int cColumns);
/// <summary>Gets the sort columns currently applied to the view.</summary> /// <summary>Gets the sort columns currently applied to the view.</summary>
/// <param name="rgSortColumns"> /// <param name="rgSortColumns">
@ -618,7 +618,7 @@ namespace Vanara.PInvoke
/// </param> /// </param>
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getsortcolumns HRESULT // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getsortcolumns HRESULT
// GetSortColumns( SORTCOLUMN *rgSortColumns, int cColumns ); // GetSortColumns( SORTCOLUMN *rgSortColumns, int cColumns );
void GetSortColumns([In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] SORTCOLUMN[] rgSortColumns, int cColumns); void GetSortColumns([In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] SORTCOLUMN[] rgSortColumns, [In] int cColumns);
/// <summary>Retrieves an object that represents a specified item.</summary> /// <summary>Retrieves an object that represents a specified item.</summary>
/// <param name="iItem"> /// <param name="iItem">
@ -635,8 +635,8 @@ namespace Vanara.PInvoke
/// </returns> /// </returns>
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getitem HRESULT GetItem( int // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getitem HRESULT GetItem( int
// iItem, REFIID riid, void **ppv ); // iItem, REFIID riid, void **ppv );
[return: MarshalAs(UnmanagedType.IUnknown)] [return: MarshalAs(UnmanagedType.IUnknown, IidParameterIndex = 0)]
object GetItem(int iItem, in Guid riid); object GetItem([In] int iItem, in Guid riid);
/// <summary>Gets the next visible item in relation to a given index in the view.</summary> /// <summary>Gets the next visible item in relation to a given index in the view.</summary>
/// <param name="iStart"> /// <param name="iStart">
@ -672,7 +672,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getvisibleitem HRESULT // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getvisibleitem HRESULT
// GetVisibleItem( int iStart, BOOL fPrevious, int *piItem ); // GetVisibleItem( int iStart, BOOL fPrevious, int *piItem );
[PreserveSig] [PreserveSig]
HRESULT GetVisibleItem(int iStart, [MarshalAs(UnmanagedType.Bool)] bool fPrevious, out int piItem); HRESULT GetVisibleItem([In] int iStart, [In, MarshalAs(UnmanagedType.Bool)] bool fPrevious, out int piItem);
/// <summary>Locates the currently selected item at or after a given index.</summary> /// <summary>Locates the currently selected item at or after a given index.</summary>
/// <param name="iStart">The index position from which to start searching for the currently selected item.</param> /// <param name="iStart">The index position from which to start searching for the currently selected item.</param>
@ -696,7 +696,7 @@ namespace Vanara.PInvoke
/// </list> /// </list>
/// </returns> /// </returns>
[PreserveSig] [PreserveSig]
HRESULT GetSelectedItem(int iStart, out int piItem); HRESULT GetSelectedItem([In] int iStart, out int piItem);
/// <summary> /// <summary>
/// <para>Gets the current selection as an IShellItemArray.</para> /// <para>Gets the current selection as an IShellItemArray.</para>
@ -730,7 +730,7 @@ namespace Vanara.PInvoke
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getselection HRESULT // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getselection HRESULT
// GetSelection( BOOL fNoneImpliesFolder, IShellItemArray **ppsia ); // GetSelection( BOOL fNoneImpliesFolder, IShellItemArray **ppsia );
[PreserveSig] [PreserveSig]
HRESULT GetSelection([MarshalAs(UnmanagedType.Bool)] bool fNoneImpliesFolder, out IShellItemArray ppsia); HRESULT GetSelection([In, MarshalAs(UnmanagedType.Bool)] bool fNoneImpliesFolder, out IShellItemArray ppsia);
/// <summary>Gets the selection state including check state.</summary> /// <summary>Gets the selection state including check state.</summary>
/// <param name="pidl"> /// <param name="pidl">
@ -746,7 +746,7 @@ namespace Vanara.PInvoke
/// </returns> /// </returns>
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getselectionstate HRESULT // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-getselectionstate HRESULT
// GetSelectionState( PCUITEMID_CHILD pidl, DWORD *pdwFlags ); // GetSelectionState( PCUITEMID_CHILD pidl, DWORD *pdwFlags );
SVSIF GetSelectionState([In] PIDL pidl); SVSIF GetSelectionState([In] IntPtr pidl);
/// <summary>Invokes the given verb on the current selection.</summary> /// <summary>Invokes the given verb on the current selection.</summary>
/// <param name="pszVerb"> /// <param name="pszVerb">
@ -756,7 +756,7 @@ namespace Vanara.PInvoke
/// <remarks>If pszVerb is <c>NULL</c>, then the default verb is invoked on the selection.</remarks> /// <remarks>If pszVerb is <c>NULL</c>, then the default verb is invoked on the selection.</remarks>
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-invokeverbonselection HRESULT // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-invokeverbonselection HRESULT
// InvokeVerbOnSelection( LPCSTR pszVerb ); // InvokeVerbOnSelection( LPCSTR pszVerb );
void InvokeVerbOnSelection([MarshalAs(UnmanagedType.LPWStr)] string pszVerb); void InvokeVerbOnSelection([In, MarshalAs(UnmanagedType.LPWStr)] string pszVerb);
/// <summary>Sets and applies the view mode and image size.</summary> /// <summary>Sets and applies the view mode and image size.</summary>
/// <param name="uViewMode"> /// <param name="uViewMode">
@ -770,7 +770,7 @@ namespace Vanara.PInvoke
/// <remarks>If iImageSize is -1 then the current default icon size for the view mode is used.</remarks> /// <remarks>If iImageSize is -1 then the current default icon size for the view mode is used.</remarks>
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setviewmodeandiconsize // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setviewmodeandiconsize
// HRESULT SetViewModeAndIconSize( FOLDERVIEWMODE uViewMode, int iImageSize ); // HRESULT SetViewModeAndIconSize( FOLDERVIEWMODE uViewMode, int iImageSize );
void SetViewModeAndIconSize(FOLDERVIEWMODE uViewMode, int iImageSize); void SetViewModeAndIconSize([In] FOLDERVIEWMODE uViewMode, [In] int iImageSize = -1);
/// <summary>Gets the current view mode and icon size applied to the view.</summary> /// <summary>Gets the current view mode and icon size applied to the view.</summary>
/// <param name="puViewMode"> /// <param name="puViewMode">
@ -793,7 +793,7 @@ namespace Vanara.PInvoke
/// <remarks>If cVisibleRows is zero, subsetting is turned off.</remarks> /// <remarks>If cVisibleRows is zero, subsetting is turned off.</remarks>
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setgroupsubsetcount HRESULT // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setgroupsubsetcount HRESULT
// SetGroupSubsetCount( UINT cVisibleRows ); // SetGroupSubsetCount( UINT cVisibleRows );
void SetGroupSubsetCount(uint cVisibleRows); void SetGroupSubsetCount([In] uint cVisibleRows);
/// <summary>Gets the count of visible rows displayed for a group's subset.</summary> /// <summary>Gets the count of visible rows displayed for a group's subset.</summary>
/// <returns> /// <returns>
@ -812,7 +812,7 @@ namespace Vanara.PInvoke
/// </param> /// </param>
// https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setredraw HRESULT SetRedraw( // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nf-shobjidl_core-ifolderview2-setredraw HRESULT SetRedraw(
// BOOL fRedrawOn ); // BOOL fRedrawOn );
void SetRedraw([MarshalAs(UnmanagedType.Bool)] bool fRedrawOn); void SetRedraw([In, MarshalAs(UnmanagedType.Bool)] bool fRedrawOn);
/// <summary> /// <summary>
/// Checks to see if this view sourced the current drag-and-drop or cut-and-paste operation (used by drop target objects). /// Checks to see if this view sourced the current drag-and-drop or cut-and-paste operation (used by drop target objects).

View File

@ -1,4 +1,5 @@
using System; using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
namespace Vanara.PInvoke namespace Vanara.PInvoke
@ -18,7 +19,9 @@ namespace Vanara.PInvoke
/// <param name="ppvObject">The interface specified by the <paramref name="riid"/> parameter.</param> /// <param name="ppvObject">The interface specified by the <paramref name="riid"/> parameter.</param>
/// <returns>If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.</returns> /// <returns>If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.</returns>
[PreserveSig] [PreserveSig]
HRESULT QueryService(in Guid guidService, in Guid riid, [MarshalAs(UnmanagedType.IUnknown, IidParameterIndex = 1)] out object ppvObject); //HRESULT QueryService(in Guid guidService, in Guid riid, [MarshalAs(UnmanagedType.IUnknown, IidParameterIndex = 1)] out object ppvObject);
[MethodImpl(MethodImplOptions.InternalCall)]
HRESULT QueryService(ref Guid guidService, ref Guid riid, out IntPtr ppvObject);
} }
} }
} }

View File

@ -801,14 +801,14 @@ namespace Vanara.PInvoke
/// <summary>Enables or disables modeless dialog boxes. This method is not currently implemented.</summary> /// <summary>Enables or disables modeless dialog boxes. This method is not currently implemented.</summary>
/// <param name="enable"><c>true</c> to enable modeless dialog box windows or <c>false</c> to disable them.</param> /// <param name="enable"><c>true</c> to enable modeless dialog box windows or <c>false</c> to disable them.</param>
void EnableModeless([MarshalAs(UnmanagedType.Bool)] bool enable); void EnableModeless([In, MarshalAs(UnmanagedType.Bool)] bool enable);
/// <summary> /// <summary>
/// Called when the activation state of the view window is changed by an event that is not caused by the Shell view itself. For /// Called when the activation state of the view window is changed by an event that is not caused by the Shell view itself. For
/// example, if the TAB key is pressed when the tree has the focus, the view should be given the focus. /// example, if the TAB key is pressed when the tree has the focus, the view should be given the focus.
/// </summary> /// </summary>
/// <param name="uState">Flag specifying the activation state of the window.</param> /// <param name="uState">Flag specifying the activation state of the window.</param>
void UIActivate(SVUIA uState); void UIActivate([In] SVUIA uState);
/// <summary>Refreshes the view's contents in response to user input.</summary> /// <summary>Refreshes the view's contents in response to user input.</summary>
void Refresh(); void Refresh();
@ -828,7 +828,7 @@ namespace Vanara.PInvoke
/// </param> /// </param>
/// <param name="prcView">The dimensions of the new view, in client coordinates.</param> /// <param name="prcView">The dimensions of the new view, in client coordinates.</param>
/// <returns>The address of the window handle being created.</returns> /// <returns>The address of the window handle being created.</returns>
HWND CreateViewWindow(IShellView psvPrevious, in FOLDERSETTINGS pfs, IShellBrowser psb, in RECT prcView); HWND CreateViewWindow([In] IShellView psvPrevious, in FOLDERSETTINGS pfs, [In] IShellBrowser psb, in RECT prcView);
/// <summary>Destroys the view window.</summary> /// <summary>Destroys the view window.</summary>
void DestroyViewWindow(); void DestroyViewWindow();
@ -841,7 +841,7 @@ namespace Vanara.PInvoke
/// <param name="dwReserved">Reserved.</param> /// <param name="dwReserved">Reserved.</param>
/// <param name="lpfn">The address of the callback function used to add the pages.</param> /// <param name="lpfn">The address of the callback function used to add the pages.</param>
/// <param name="lparam">A value that must be passed as the callback function's lparam parameter.</param> /// <param name="lparam">A value that must be passed as the callback function's lparam parameter.</param>
void AddPropertySheetPages(uint dwReserved, [In] AddPropSheetPageProc lpfn, [In] IntPtr lparam); void AddPropertySheetPages([In, Optional] uint dwReserved, [In] AddPropSheetPageProc lpfn, [In] IntPtr lparam);
/// <summary>Saves the Shell's view settings so the current state can be restored during a subsequent browsing session.</summary> /// <summary>Saves the Shell's view settings so the current state can be restored during a subsequent browsing session.</summary>
void SaveViewState(); void SaveViewState();
@ -849,14 +849,14 @@ namespace Vanara.PInvoke
/// <summary>Changes the selection state of one or more items within the Shell view window.</summary> /// <summary>Changes the selection state of one or more items within the Shell view window.</summary>
/// <param name="pidlItem">The address of the ITEMIDLIST structure.</param> /// <param name="pidlItem">The address of the ITEMIDLIST structure.</param>
/// <param name="uFlags">One of the _SVSIF constants that specify the type of selection to apply.</param> /// <param name="uFlags">One of the _SVSIF constants that specify the type of selection to apply.</param>
void SelectItem(PIDL pidlItem, SVSIF uFlags); void SelectItem([In] IntPtr pidlItem, [In] SVSIF uFlags);
/// <summary>Gets an interface that refers to data presented in the view.</summary> /// <summary>Gets an interface that refers to data presented in the view.</summary>
/// <param name="uItem">The constants that refer to an aspect of the view.</param> /// <param name="uItem">The constants that refer to an aspect of the view.</param>
/// <param name="riid">The identifier of the COM interface being requested.</param> /// <param name="riid">The identifier of the COM interface being requested.</param>
/// <returns>The address that receives the interface pointer. If an error occurs, the pointer returned must be NULL.</returns> /// <returns>The address that receives the interface pointer. If an error occurs, the pointer returned must be NULL.</returns>
[return: MarshalAs(UnmanagedType.IUnknown)] [return: MarshalAs(UnmanagedType.IUnknown, IidParameterIndex = 1)]
object GetItemObject(SVGIO uItem, in Guid riid); object GetItemObject([In] SVGIO uItem, in Guid riid);
} }
/// <summary> /// <summary>