/// <summary>
        ///     Read the menu item.
        /// </summary>
        /// <param name="lpRes">Address in memory.</param>
        /// <returns>End of the menu item structure.</returns>
        internal virtual IntPtr Read(IntPtr lpRes) {
            _header = (MenuExItemTemplate)Marshal.PtrToStructure(lpRes, typeof (MenuExItemTemplate));

            lpRes = new IntPtr(lpRes.ToInt32() + Marshal.SizeOf(_header));

            switch ((UInt32)Marshal.ReadInt32(lpRes)) {
                case 0:
                    break;
                default:
                    _menuString = Marshal.PtrToStringUni(lpRes);
                    lpRes = new IntPtr(lpRes.ToInt32() + (_menuString.Length + 1)*Marshal.SystemDefaultCharSize);
                    break;
            }

            return lpRes;
        }
Пример #2
0
        /// <summary>
        ///     Read the menu item.
        /// </summary>
        /// <param name="lpRes">Address in memory.</param>
        /// <returns>End of the menu item structure.</returns>
        internal virtual IntPtr Read(IntPtr lpRes)
        {
            _header = (MenuExItemTemplate)Marshal.PtrToStructure(lpRes, typeof(MenuExItemTemplate));

            lpRes = new IntPtr(lpRes.ToInt32() + Marshal.SizeOf(_header));

            switch ((UInt32)Marshal.ReadInt32(lpRes))
            {
            case 0:
                break;

            default:
                _menuString = Marshal.PtrToStringUni(lpRes);
                lpRes       = new IntPtr(lpRes.ToInt32() + (_menuString.Length + 1) * Marshal.SystemDefaultCharSize);
                break;
            }

            return(lpRes);
        }