コード例 #1
0
ファイル: IconFile.cs プロジェクト: zellus/coapp.powershell
        /// <summary>
        ///     Read icons.
        /// </summary>
        /// <param name="lpData">Pointer to the beginning of a FILEGRPICONDIR structure.</param>
        /// <returns>Pointer to the end of a FILEGRPICONDIR structure.</returns>
        internal IntPtr Read(IntPtr lpData)
        {
            _icons.Clear();

            _header = (FileGrpIconDir)Marshal.PtrToStructure(lpData, typeof(FileGrpIconDir));

            var lpEntry = new IntPtr(lpData.ToInt32() + Marshal.SizeOf(_header));

            for (var i = 0; i < _header.wCount; i++)
            {
                var iconFileIcon = new IconFileIcon();
                lpEntry = iconFileIcon.Read(lpEntry, lpData);
                _icons.Add(iconFileIcon);
            }

            return(lpEntry);
        }
コード例 #2
0
ファイル: IconFile.cs プロジェクト: roomaroo/coapp.powershell
        /// <summary>
        ///     Read icons.
        /// </summary>
        /// <param name="lpData">Pointer to the beginning of a FILEGRPICONDIR structure.</param>
        /// <returns>Pointer to the end of a FILEGRPICONDIR structure.</returns>
        internal IntPtr Read(IntPtr lpData) {
            _icons.Clear();

            _header = (FileGrpIconDir)Marshal.PtrToStructure(lpData, typeof (FileGrpIconDir));

            var lpEntry = new IntPtr(lpData.ToInt32() + Marshal.SizeOf(_header));

            for (var i = 0; i < _header.wCount; i++) {
                var iconFileIcon = new IconFileIcon();
                lpEntry = iconFileIcon.Read(lpEntry, lpData);
                _icons.Add(iconFileIcon);
            }

            return lpEntry;
        }