using System; using System.Runtime.InteropServices; namespace Vanara.PInvoke { public static partial class Shell32 { /// Flags for [PInvokeData("shobjidl_core.h", MSDNShortId = "NN:shobjidl_core.INewMenuClient")] public enum NMCII_FLAGS { /// None. NMCII_NONE = 0x0000, /// Non-folder items. NMCII_ITEMS = 0x0001, /// Folder items. NMCII_FOLDERS = 0x0002, } /// Flags for [PInvokeData("shobjidl_core.h", MSDNShortId = "NN:shobjidl_core.INewMenuClient")] public enum NMCSAEI_FLAGS { /// Select the item. NMCSAEI_SELECT = 0x0000, /// Edit the item. NMCSAEI_EDIT = 0x0001, } /// Exposes methods that allow manipulation of items in a Windows 7 menu. // https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nn-shobjidl_core-inewmenuclient [PInvokeData("shobjidl_core.h", MSDNShortId = "NN:shobjidl_core.INewMenuClient")] [ComImport, Guid("dcb07fdc-3bb5-451c-90be-966644fed7b0"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] public interface INewMenuClient { /// Allows the view to filter the items shown in the menu. /// /// Type: NMCII_FLAGS* /// Pointer to a value that, when this method returns successfully, contains one of the following values: /// NMCII_NONE (0x0000) /// 0x0000. /// NMCII_ITEMS (0x0001) /// 0x0001. Non-folder items. /// NMCII_FOLDERS (0x0002) /// 0x0002. Folder items. /// /// /// Type: HRESULT /// If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. /// // https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inewmenuclient-includeitems HRESULT // IncludeItems( NMCII_FLAGS *pflags ); [PreserveSig] HRESULT IncludeItems(out NMCII_FLAGS pflags); /// Selects or edits the specified item in the menu. /// Type: PCIDLIST_ABSOLUTE /// /// Type: NMCSAEI_FLAGS /// NMCSAEI_SELECT (0x0000) /// 0x0000. Select the item. /// NMCSAEI_EDIT (0x0001) /// 0x0001. Edit the item. /// /// /// Type: HRESULT /// If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code. /// // https://docs.microsoft.com/en-us/windows/win32/api/shobjidl_core/nf-shobjidl_core-inewmenuclient-selectandedititem HRESULT // SelectAndEditItem( PCIDLIST_ABSOLUTE pidlItem, NMCSAEI_FLAGS flags ); [PreserveSig] HRESULT SelectAndEditItem([In] PIDL pidlItem, NMCSAEI_FLAGS flags); } } }