|
using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using System.Runtime.InteropServices;
using System.IO;
namespace Vestris.ResourceLib
{
/// <summary>
/// This structure depicts the organization of data in a hardware-independent icon resource.
/// </summary>
public class IconDirectoryResource : DirectoryResource<IconResource>
{
/// <summary>
/// A hardware-independent icon resource.
/// </summary>
/// <param name="hModule">Module handle.</param>
/// <param name="hResource">Resource ID.</param>
/// <param name="type">Resource type.</param>
/// <param name="name">Resource name.</param>
/// <param name="language">Language ID.</param>
/// <param name="size">Resource size.</param>
internal IconDirectoryResource(IntPtr hModule, IntPtr hResource, ResourceId type, ResourceId name, UInt16 language, int size)
: base(hModule, hResource, type, name, language, size)
{
}
/// <summary>
/// A new hardware-independent icon resource.
/// </summary>
public IconDirectoryResource()
: base(Kernel32.ResourceTypes.RT_GROUP_ICON)
{
}
/// <summary>
/// A new collection of icons that can be embedded into an executable file.
/// </summary>
public IconDirectoryResource(IconFile iconFile)
: base(Kernel32.ResourceTypes.RT_GROUP_ICON)
{
for (UInt16 id = 0; id < iconFile.Icons.Count; id++)
{
IconResource iconResource = new IconResource(
iconFile.Icons[id], new ResourceId(id), _language);
Icons.Add(iconResource);
}
}
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Daniel Doubrovkine has been in software engineering for twelve years and is currently development manager at Application Security Inc. in New York City. He has been involved in many software ventures, including Xo3 and Vestris Inc, was a development lead at Microsoft Corp. in Redmond, and director of Engineering at Visible Path Corp. in New York City. Daniel also builds and runs a foodie website, http://www.foodcandy.com.