Exemplo n.º 1
0
        /// <summary>
        /// Read the menu template.
        /// </summary>
        /// <param name="lpRes">Address in memory.</param>
        internal override IntPtr Read(IntPtr lpRes)
        {
            _header = (User32.MENUEXTEMPLATE) Marshal.PtrToStructure(
                lpRes, typeof(User32.MENUEXTEMPLATE));

            IntPtr lpMenuItem = ResourceUtil.Align(lpRes.ToInt64() 
                + Marshal.SizeOf(_header) 
                + _header.wOffset);

            return _menuItems.Read(lpMenuItem);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Read the menu template.
        /// </summary>
        /// <param name="lpRes">Address in memory.</param>
        internal override IntPtr Read(IntPtr lpRes)
        {
            _header = (User32.MENUEXTEMPLATE) Marshal.PtrToStructure(
                lpRes, typeof(User32.MENUEXTEMPLATE));

            IntPtr lpMenuItem = new IntPtr(lpRes.ToInt32()
                + _header.wOffset // offset from offset field
                + 4 // offset of the offset field
                );

            return _menuItems.Read(lpMenuItem);
        }