Files
SabreTools.Models/PortableExecutable/MenuItemExtended.cs

45 lines
1.4 KiB
C#
Raw Permalink Normal View History

2024-04-23 13:36:24 -04:00
using System.Runtime.InteropServices;
namespace SabreTools.Models.PortableExecutable
2023-09-04 00:11:04 -04:00
{
/// <summary>
/// Defines a menu item in an extended menu template. This structure definition is for
/// explanation only; it is not present in any standard header file.
/// </summary>
/// <see href="https://learn.microsoft.com/en-us/windows/win32/menurc/menuex-template-item"/>
2024-04-23 13:36:24 -04:00
[StructLayout(LayoutKind.Sequential)]
2024-05-15 14:08:14 -04:00
public sealed class MenuItemExtended : MenuItem
2023-09-04 00:11:04 -04:00
{
/// <summary>
/// Describes the menu item.
/// </summary>
2024-04-23 13:36:24 -04:00
[MarshalAs(UnmanagedType.U4)]
public MenuFlags ItemType;
2023-09-04 00:11:04 -04:00
/// <summary>
/// Describes the menu item.
/// </summary>
2024-04-23 13:36:24 -04:00
[MarshalAs(UnmanagedType.U4)]
public MenuFlags State;
2023-09-04 00:11:04 -04:00
/// <summary>
/// A numeric expression that identifies the menu item that is passed in the
/// WM_COMMAND message.
/// </summary>
2024-04-23 13:36:24 -04:00
public uint ID;
2023-09-04 00:11:04 -04:00
/// <summary>
/// A set of bit flags that specify the type of menu item.
/// </summary>
2024-04-23 13:36:24 -04:00
[MarshalAs(UnmanagedType.U4)]
public MenuFlags Flags;
2023-09-04 00:11:04 -04:00
/// <summary>
/// A null-terminated Unicode string that contains the text for this menu item.
/// There is no fixed limit on the size of this string.
/// </summary>
2024-04-23 13:36:24 -04:00
[MarshalAs(UnmanagedType.LPWStr)]
public string? MenuText;
2023-09-04 00:11:04 -04:00
}
}