using System; using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; //using System.Linq; using System.Text; using System.Windows.Forms; using Bruce_Banner.Properties; namespace Bruce_Banner { public partial class Form1: Form { public Hashtable level2color; public Form1() { InitializeComponent(); } // From http://www.devhood.com/messages/message_view-2.aspx?thread_id=90408 protected override void WndProc(ref System.Windows.Forms.Message m) { if (m.Msg != 0x0010) { base.WndProc(ref m); } } private void Form1_Load(object sender, EventArgs e) { this.SetDesktopLocation(this.Location.X, 0); this.FormBorderStyle = FormBorderStyle.FixedToolWindow; this.ShowInTaskbar = false; this.level2color = new Hashtable(); this.level2color.Add("UNCLASSIFIED", System.Drawing.Color.Green); this.level2color.Add("CONFIDENTIAL", System.Drawing.Color.Cyan); this.level2color.Add("SECRET", System.Drawing.Color.Red); this.level2color.Add("TOP SECRET", System.Drawing.Color.Orange); // From http://www.csharp411.com/hide-form-from-alttab/ this.setLevel(Settings.Default.level); } private void setLevel(String level) { this.label.Text=level; this.BackColor=(System.Drawing.Color) this.level2color[level]; this.label.Location = new System.Drawing.Point(this.Width / 2 - this.label.Width / 2, this.Height / 2 - this.label.Height / 2 - 2); int i; for (i = 0; i < this.setLevelMenuItem.DropDownItems.Count; i++) { ToolStripMenuItem ts=(ToolStripMenuItem) this.setLevelMenuItem.DropDownItems[i]; ts.Checked = (ts.Text == level); } } private void quit_Clicked(object sender, EventArgs e) { notifyIcon.Dispose(); Application.Exit(); } private void tickLevel(object sender, EventArgs e) { ToolStripMenuItem ts = (ToolStripMenuItem)sender; this.setLevel(ts.Text); Settings.Default.level = ts.Text; Settings.Default.Save(); } private void about_Click(object sender, EventArgs e) { AboutBox a=new AboutBox(); a.Show(); } } }