static SystemMenuItemInfo ConvertMenuItemInfo(MENUITEMINFO info, IntPtr parentMenuHandle)
        {
            if (info == null)
            {
                return(null);
            }

            var newInfo = new SystemMenuItemInfo
            {
                Checked          = (info.fState & 8) == 8,
                Enabled          = (info.fState & 3) == 0, //这个fState并不像文档说的禁用是3,也可能是1,猜测1=GRAYED,2=DISABLED,总之1~3都表示禁用
                Id               = info.wID,
                SubMenuHandle    = info.hSubMenu,
                Type             = (SystemMenuItemType)info.fType,
                ParentMenuHandle = parentMenuHandle
            };

            //菜单项的文本和快捷键是以一个TAB作分隔
            var texts = info.dwTypeData?.Split('\t') ?? new[] { "" };

            newInfo.Text = texts[0];

            try
            {
                if (texts.Length > 1 && TypeDescriptor.GetConverter(typeof(Keys)).ConvertFromString(texts[1]) is Keys keys)
                {
                    newInfo.Shortcut = (Shortcut)keys;
                }
            }
            catch
            {
                // ignored
            }

            return(newInfo);
        }
 public SystemMenuItemEventArgs(SystemMenuItemInfo info)
 {
     Info = info;
 }