diff --git a/PInvoke/Shell32/ShObjIdl.ICommDlgBrowser.cs b/PInvoke/Shell32/ShObjIdl.ICommDlgBrowser.cs index adf91a42..8b5ab956 100644 --- a/PInvoke/Shell32/ShObjIdl.ICommDlgBrowser.cs +++ b/PInvoke/Shell32/ShObjIdl.ICommDlgBrowser.cs @@ -95,7 +95,7 @@ namespace Vanara.PInvoke /// The browser should return S_OK to include the object in the view, or S_FALSE to hide it. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] [PreserveSig] - HRESULT IncludeObject([In] IShellView ppshv, [In] PIDL pidl); + HRESULT IncludeObject([In] IShellView ppshv, [In] IntPtr pidl); } /* @@ -187,7 +187,7 @@ namespace Vanara.PInvoke /// The browser should return S_OK to include the object in the view, or S_FALSE to hide it. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] [PreserveSig] - HRESULT IncludeObject([In] IShellView ppshv, [In] PIDL pidl); + HRESULT IncludeObject([In] IShellView ppshv, [In] IntPtr pidl); /// Called by the Shell view to get the default shortcut menu text. /// A pointer to the view's IShellView interface. diff --git a/PInvoke/Shell32/ShObjIdl.IExplorerBrowser.cs b/PInvoke/Shell32/ShObjIdl.IExplorerBrowser.cs index 521e555f..1b344073 100644 --- a/PInvoke/Shell32/ShObjIdl.IExplorerBrowser.cs +++ b/PInvoke/Shell32/ShObjIdl.IExplorerBrowser.cs @@ -167,7 +167,7 @@ namespace Vanara.PInvoke /// /// A pointer to a FOLDERSETTINGS structure that determines how the folder will be displayed in the view. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] - void Initialize([In] HWND hwndParent, in RECT prc, [Optional] PFOLDERSETTINGS pfs); + void Initialize([In] IntPtr hwndParent, in RECT prc, [Optional] PFOLDERSETTINGS pfs); /// Destroys the browser. [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] @@ -215,10 +215,12 @@ namespace Vanara.PInvoke /// Sets the current browser options. /// One or more EXPLORER_BROWSER_OPTIONS flags to be set. + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] void SetOptions([In] EXPLORER_BROWSER_OPTIONS dwFlag); /// Gets the current browser options. /// When this method returns, contains the current EXPLORER_BROWSER_OPTIONS for the browser. + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] void GetOptions(out EXPLORER_BROWSER_OPTIONS pdwFlag); /// Browses to a pointer to an item identifier list (PIDL) @@ -227,12 +229,15 @@ namespace Vanara.PInvoke /// This parameter can be NULL. For more information, see Remarks. /// /// A flag that specifies the category of the pidl. This affects how navigation is accomplished. + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] void BrowseToIDList([In] PIDL pidl, [In] SBSP uFlags); /// Browses to an object. /// A pointer to an object to browse to. If the object cannot be browsed, an error value is returned. /// A flag that specifies the category of the pidl. This affects how navigation is accomplished. - void BrowseToObject([In, MarshalAs(UnmanagedType.IUnknown)] object punk, [In] SBSP uFlags); + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] + [PreserveSig] + HRESULT BrowseToObject([MarshalAs(UnmanagedType.IUnknown)] object punk, SBSP uFlags); /// Creates a results folder and fills it with items. /// @@ -240,9 +245,11 @@ namespace Vanara.PInvoke /// can be used with INamespaceWalk. /// /// One of the EXPLORER_BROWSER_FILL_FLAGS values. + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] void FillFromObject([In, MarshalAs(UnmanagedType.IUnknown)] object punk, [In] EXPLORER_BROWSER_FILL_FLAGS dwFlags); /// Removes all items from the results folder. + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] void RemoveAll(); /// Gets an interface for the current view of the browser. @@ -251,6 +258,7 @@ namespace Vanara.PInvoke /// When this method returns, contains the interface pointer requested in . This will typically be /// IShellView, IShellView2, IFolderView, or a related interface. /// + [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] [return: MarshalAs(UnmanagedType.Interface, IidParameterIndex = 0)] object GetCurrentView(in Guid riid); } @@ -280,7 +288,7 @@ namespace Vanara.PInvoke // HRESULT OnNavigationPending( PCIDLIST_ABSOLUTE pidlFolder ); [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] [PreserveSig] - HRESULT OnNavigationPending([In] PIDL pidlFolder); + HRESULT OnNavigationPending([In] IntPtr pidlFolder); /// Notifies clients that the view of the Explorer browser has been created and can be modified. /// @@ -322,7 +330,7 @@ namespace Vanara.PInvoke // HRESULT OnNavigationComplete( PCIDLIST_ABSOLUTE pidlFolder ); [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] [PreserveSig] - HRESULT OnNavigationComplete([In] PIDL pidlFolder); + HRESULT OnNavigationComplete([In] IntPtr pidlFolder); /// Notifies clients that the Explorer browser has failed to navigate to a Shell folder. /// @@ -346,7 +354,7 @@ namespace Vanara.PInvoke // HRESULT OnNavigationFailed( PCIDLIST_ABSOLUTE pidlFolder ); [MethodImpl(MethodImplOptions.InternalCall, MethodCodeType = MethodCodeType.Runtime)] [PreserveSig] - HRESULT OnNavigationFailed([In] PIDL pidlFolder); + HRESULT OnNavigationFailed([In] IntPtr pidlFolder); } /// Extension method to simplify using the method. diff --git a/PInvoke/Shell32/ShObjIdl.IShellView.cs b/PInvoke/Shell32/ShObjIdl.IShellView.cs index 89ee7ccb..0ce17475 100644 --- a/PInvoke/Shell32/ShObjIdl.IShellView.cs +++ b/PInvoke/Shell32/ShObjIdl.IShellView.cs @@ -1119,7 +1119,7 @@ namespace Vanara.PInvoke /// Contains folder view information. [PInvokeData("Shobjidl.h")] - [StructLayout(LayoutKind.Sequential)] + [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct FOLDERSETTINGS { /// Folder view mode.