namespace Vanara.PInvoke; public static partial class Shell32 { /// /// Exposes a method that unpins an application shortcut from the Start menu or the taskbar. /// /// /// When to Implement /// Windows provides an implementation of this interface as CLSID_StartMenuPin. Third parties do not provide their own implementation. /// When to Use /// /// Any shortcut installed by an application might have been subsequently pinned by the user, and there is no way for an application /// to know this. Therefore, we recommend that, during uninstallation, all applications call IStartMenuPinnedList::RemoveFromList on /// each shortcut they installed. /// /// /// Note that IStartMenuPinnedList does not remove the shortcuts themselves, it only unpins them. Applications first call /// IStartMenuPinnedList::RemoveFromList on a shortcut, then delete that shortcut. /// /// Compatibility /// /// In Windows 8, the Start screen replaces the legacy Start menu. CLSID_StartMenuPin and IStartMenuPinnedList are present in Windows /// 8 to provide backward compatibility with existing applications, but they do not affect tiles pinned to the Windows 8 Start /// screen. CLSID_StartMenuPin and IStartMenuPinnedList do continue to impact items pinned to the Windows 8 desktop taskbar. /// /// // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl/nn-shobjidl-istartmenupinnedlist [PInvokeData("shobjidl.h", MSDNShortId = "e1f4dbdb-34c0-4bf5-bb8b-a622a81c1617")] [ComImport, Guid("4CD19ADA-25A5-4A32-B3B7-347BEE5BE36B"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), CoClass(typeof(StartMenuPin))] public interface IStartMenuPinnedList { /// /// Windows Vista: Removes an item from the Start menu pinned list, which is the list in the upper left position of the /// Start menu. /// Windows 7: Removes an item from the Start menu pinned list and unpins the item from the taskbar. /// /// Windows 8: Unpins the item from the taskbar but does not remove the item from the Start screen. Items cannot be /// programmatically removed from Start; they can only be unpinned by the user or removed as part of a program's uninstallation. /// /// /// A pointer to an IShellItem object that represents the item to unpin. /// /// /// /// Returns S_OK if the item was successfully removed from the list of pinned items and/or the taskbar. /// /// /// Returns S_OK if the item was not pinned at all. /// /// /// Returns a standard error code otherwise. /// /// /// [PreserveSig] HRESULT RemoveFromList([In] IShellItem pitem); } /// CoClass for IStartMenuPinnedList (CLSID_StartMenuPin). [PInvokeData("shobjidl.h")] [ComImport, Guid("a2a9545d-a0c2-42b4-9708-a0b2badd77c8"), ClassInterface(ClassInterfaceType.None)] public class StartMenuPin { } }