diff --git a/PInvoke/Shell32/ShObjIdl.IContextMenu.cs b/PInvoke/Shell32/ShObjIdl.IContextMenu.cs
index 8b7048b2..e0d537d2 100644
--- a/PInvoke/Shell32/ShObjIdl.IContextMenu.cs
+++ b/PInvoke/Shell32/ShObjIdl.IContextMenu.cs
@@ -15,6 +15,7 @@ namespace Vanara.PInvoke
public const string CMDSTR_VIEWLIST = "ViewList";
/// Flag options for the IContextMenu interface.
+ [PInvokeData("Shobjidl.h")]
[Flags]
public enum CMF : uint
{
@@ -106,6 +107,7 @@ namespace Vanara.PInvoke
}
/// Indicate desired behavior and indicate that other fields in the structure are to be used for .
+ [PInvokeData("Shobjidl.h")]
[Flags]
public enum CMIC : uint
{
@@ -164,6 +166,7 @@ namespace Vanara.PInvoke
}
/// Flags specifying the information to return.
+ [PInvokeData("Shobjidl.h")]
public enum GCS : uint
{
/// Sets pszName to an ANSI string containing the language-independent command name for the menu item.
@@ -184,10 +187,9 @@ namespace Vanara.PInvoke
GCS_UNICODE = 0x00000004,
}
- ///
- /// Exposes methods that either create or merge a shortcut menu associated with a Shell object. Allows client objects to handle messages associated with
- /// owner-drawn menu items and extends IContextMenu2 by accepting a return value from that message handling.
- ///
+ /// Exposes methods that either create or merge a shortcut menu associated with a Shell object.
+ // https://msdn.microsoft.com/en-us/library/windows/desktop/bb776095(v=vs.85).aspx
+ [PInvokeData("Shobjidl.h", MSDNShortId = "bb776095")]
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("000214E4-0000-0000-c000-000000000046")]
public interface IContextMenu
{
@@ -222,9 +224,36 @@ namespace Vanara.PInvoke
}
///
- /// Exposes methods that either create or merge a shortcut (context) menu associated with a Shell object. Extends IContextMenu by adding a method that
- /// allows client objects to handle messages associated with owner-drawn menu items.
+ /// Exposes methods that either create or merge a shortcut (context) menu associated with a Shell object. Extends IContextMenu by
+ /// adding a method that allows client objects to handle messages associated with owner-drawn menu items.
///
+ ///
+ /// This interface also provides the methods of the IContextMenu interface, from which it inherits.
+ /// NoteWindows Vista and later. Prior to Windows Vista this interface was declared in Shlobj.h.
+ /// When to Implement
+ ///
+ /// Implement IContextMenu2 if your namespace extension or shortcut menu handler needs to process one or more of the following messages.
+ ///
+ ///
+ /// -
+ /// MENUPOPUP
+ ///
+ /// -
+ /// ITEM
+ ///
+ /// -
+ /// WM_MEASUREITEM
+ ///
+ ///
+ ///
+ /// These messages are forwarded to IContextMenu2—through the HandleMenuMsg method—only if a QueryInterface call for an IContextMenu2
+ /// interface pointer is successful, indicating that the object supports this interface.
+ ///
+ /// When to Use
+ /// Applications do not normally call this interface directly.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nn-shobjidl_core-icontextmenu2
+ [PInvokeData("shobjidl_core.h", MSDNShortId = "4e3331ad-4adc-4ea9-8a22-6aad15f618c8")]
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("000214F4-0000-0000-c000-000000000046")]
public interface IContextMenu2 : IContextMenu
{
@@ -268,9 +297,25 @@ namespace Vanara.PInvoke
}
///
- /// Exposes methods that either create or merge a shortcut menu associated with a Shell object. Allows client objects to handle messages associated with
- /// owner-drawn menu items and extends IContextMenu2 by accepting a return value from that message handling.
+ ///
+ /// Exposes methods that either create or merge a shortcut menu associated with a Shell object. Allows client objects to handle
+ /// messages associated with owner-drawn menu items and extends IContextMenu2 by accepting a return value from that message handling.
+ ///
///
+ ///
+ /// This interface also provides the methods of the IContextMenu and IContextMenu2 interfaces, from which it inherits.
+ /// When to Implement
+ /// Implement IContextMenu3 if your shortcut menu extension needs to process the WM_MENUCHAR message.
+ ///
+ /// This message is forwarded to IContextMenu3::HandleMenuMsg2 only if a QueryInterface call for an IContextMenu3 interface
+ /// pointer is successful, which indicates that the object supports this interface.
+ ///
+ /// When to Use
+ /// You do not call this interface directly. IContextMenu3 is used by the operating system only when it has confirmed that your application is aware of this interface.
+ /// NoteWindows Vista and later. Prior to Windows Vista this interface was declared in Shlobj.h.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nn-shobjidl_core-icontextmenu3
+ [PInvokeData("shobjidl_core.h", MSDNShortId = "c08e1b98-2b8b-41f6-93c5-3a5937bd3b2c")]
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), GuidAttribute("bcfce0a0-ec17-11d0-8d10-00a0c90f2719")]
public interface IContextMenu3 : IContextMenu2
{
@@ -324,8 +369,18 @@ namespace Vanara.PInvoke
}
///
- /// Exposes a method that enables the callback of a context menu. For example, to add a shield icon to a menuItem that requires elevation.
+ /// Exposes a method that enables the callback of a context menu. For example, to add a shield icon to a menuItem that
+ /// requires elevation.
///
+ ///
+ /// This is the callback interface specified in the DEFCONTEXTMENU structure passed with the function SHCreateDefaultContextMenu.
+ ///
+ /// This interface enables IShellFolder implementations to manage context menu messages before, after, and during the context menu
+ /// handling of these messages.
+ ///
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/nn-shobjidl_core-icontextmenucb
+ [PInvokeData("shobjidl_core.h", MSDNShortId = "1a4c183b-97cf-4c9a-af5a-bcea7c2755a5")]
[ComImport, InterfaceType(ComInterfaceType.InterfaceIsIUnknown), Guid("3409E930-5A39-11d1-83FA-00A0C90DC849")]
public interface IContextMenuCB
{
@@ -376,9 +431,29 @@ namespace Vanara.PInvoke
*/
///
- /// Contains extended information about a shortcut menu command. This structure is an extended version of CMINVOKECOMMANDINFO that allows the use of
- /// Unicode values.
+ /// Contains extended information about a shortcut menu command. This structure is an extended version of CMINVOKECOMMANDINFO that
+ /// allows the use of Unicode values.
///
+ ///
+ ///
+ /// Although the IContextMenu::InvokeCommand declaration specifies a CMINVOKECOMMANDINFO structure for the parameter, it can also
+ /// accept a CMINVOKECOMMANDINFOEX structure. If you are implementing this method, you must inspect cbSize to determine
+ /// which structure has been passed.
+ ///
+ ///
+ /// By default, all 16-bit Windows-based applications run as threads in a single, shared VDM. The advantage of running separately is
+ /// that a crash only terminates the single VDM; any other programs running in distinct VDMs continue to function normally. Also,
+ /// 16-bit Windows-based applications that are run in separate VDMs have separate input queues. That means that if one application
+ /// stops responding momentarily, applications in separate VDMs continue to receive input. The disadvantage of running separately is
+ /// that it takes significantly more memory to do so.
+ ///
+ ///
+ /// CMINVOKECOMMANDINFOEX itself is defined in Shobjidl.h, but you must also include Shellapi.h to have full access to all flags.
+ ///
+ /// Note Prior to Windows Vista, this structure was declared in Shlobj.h.
+ ///
+ // https://docs.microsoft.com/en-us/windows/desktop/api/shobjidl_core/ns-shobjidl_core-_cminvokecommandinfoex
+ [PInvokeData("shobjidl_core.h", MSDNShortId = "c4c7f053-fdb1-4bba-9eb9-a514ce1d90f6")]
[StructLayout(LayoutKind.Sequential)]
public struct CMINVOKECOMMANDINFOEX
{