using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Microsoft.WindowsAPICodePack.Shell;
using Microsoft.WindowsAPICodePack.Taskbar;
namespace Win7NewFeatures.Taskbar
{
public partial class frmIconOverlays : Form
{
public frmIconOverlays()
{
InitializeComponent();
}
private void frmIconOverlays_Load(object sender, EventArgs e)
{
this.cmbIcon.Items.AddRange(Enum.GetNames(typeof(StockIconIdentifier)));
this.cmbIconSize.Items.AddRange(Enum.GetNames(typeof(StockIconSizes)));
}
private void btnClearIcon_Click(object sender, EventArgs e)
{
TaskbarManager.Instance.SetOverlayIcon(this.Handle, null, "");
}
private void chkLink_CheckedChanged(object sender, EventArgs e)
{
this.SetIconOverlay();
}
private void chkSelected_CheckedChanged(object sender, EventArgs e)
{
this.SetIconOverlay();
}
private void cmbIcon_TextChanged(object sender, EventArgs e)
{
this.SetIconOverlay();
}
private void cmbIconSize_TextChanged(object sender, EventArgs e)
{
this.SetIconOverlay();
}
public void SetIconOverlay()
{
if (!((this.cmbIcon.Text == null) | (this.cmbIconSize.Text == null)))
{
StockIconIdentifier ID = (StockIconIdentifier) (Enum.Parse(typeof(StockIconIdentifier), this.cmbIcon.Text));
StockIconSizes Size = (StockIconSizes) (Enum.Parse(typeof(StockIconSizes), this.cmbIconSize.Text, true));
StockIcon SelectedIcon = new StockIcon(ID, Size, this.chkLink.Checked, this.chkSelected.Checked);
TaskbarManager.Instance.SetOverlayIcon(this.Handle, SelectedIcon.Icon, "hihi");
}
}
}
}