diff --git a/exhibit/Form1.Designer.cs b/exhibit/Form1.Designer.cs index f836b8b..b4b2b45 100644 --- a/exhibit/Form1.Designer.cs +++ b/exhibit/Form1.Designer.cs @@ -30,6 +30,7 @@ private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.panel1 = new System.Windows.Forms.Panel(); + this.textBox2 = new System.Windows.Forms.TextBox(); this.checkBox1 = new System.Windows.Forms.CheckBox(); this.linkLabel1 = new System.Windows.Forms.LinkLabel(); this.button1 = new System.Windows.Forms.Button(); @@ -41,7 +42,6 @@ private void InitializeComponent() this.RunStrip = new System.Windows.Forms.ToolStripMenuItem(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.Exit = new System.Windows.Forms.ToolStripMenuItem(); - this.textBox2 = new System.Windows.Forms.TextBox(); this.panel1.SuspendLayout(); this.cMS1.SuspendLayout(); this.SuspendLayout(); @@ -62,9 +62,23 @@ private void InitializeComponent() this.panel1.Size = new System.Drawing.Size(460, 92); this.panel1.TabIndex = 0; // + // textBox2 + // + this.textBox2.BorderStyle = System.Windows.Forms.BorderStyle.None; + this.textBox2.Location = new System.Drawing.Point(193, 40); + this.textBox2.Multiline = true; + this.textBox2.Name = "textBox2"; + this.textBox2.ReadOnly = true; + this.textBox2.Size = new System.Drawing.Size(116, 42); + this.textBox2.TabIndex = 11; + this.textBox2.Text = "Press CTRL+Space to stop and keep the last color."; + this.textBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // // checkBox1 // this.checkBox1.AutoSize = true; + this.checkBox1.Checked = true; + this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; this.checkBox1.Location = new System.Drawing.Point(15, 44); this.checkBox1.Name = "checkBox1"; this.checkBox1.Size = new System.Drawing.Size(172, 17); @@ -106,6 +120,7 @@ private void InitializeComponent() this.textBox1.TabIndex = 1; this.textBox1.Text = "Color name (Hue, Saturation, Value)"; this.textBox1.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + this.textBox1.TextChanged += new System.EventHandler(this.textBox1_TextChanged); // // label1 // @@ -158,18 +173,6 @@ private void InitializeComponent() this.Exit.Text = "Exit"; this.Exit.Click += new System.EventHandler(this.Exit_Click); // - // textBox2 - // - this.textBox2.BorderStyle = System.Windows.Forms.BorderStyle.None; - this.textBox2.Location = new System.Drawing.Point(193, 40); - this.textBox2.Multiline = true; - this.textBox2.Name = "textBox2"; - this.textBox2.ReadOnly = true; - this.textBox2.Size = new System.Drawing.Size(116, 42); - this.textBox2.TabIndex = 11; - this.textBox2.Text = "Press CTRL+Space to stop and keep the last color."; - this.textBox2.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; - // // frmMain // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); diff --git a/exhibit/Form1.cs b/exhibit/Form1.cs index 34593a3..f7f2e10 100644 --- a/exhibit/Form1.cs +++ b/exhibit/Form1.cs @@ -8,12 +8,6 @@ due to their inability to differntiate certain colors. ----------------------------------------------------------------------------------------- I've used [John Gietzen] answer from this stackoverflow page [https://stackoverflow.com/questions/1483928/how-to-read-the-color-of-a-screen-pixel]. Thanks John! */ - - - - - - using System; using System.Drawing; using System.Windows.Forms; @@ -26,9 +20,9 @@ namespace exhibit { public partial class frmMain : Form { - private bool showNotification = false; + private bool showNotification = true; private List C1 = new List { }; - int count = 0; + private globalKeyboardHook gkh = new globalKeyboardHook(); private bool mouseMoveTimer = false; @@ -72,7 +66,6 @@ private void frmMain_Load(object sender, EventArgs e) notifyIcon1.BalloonTipText = "Exhibit is running."; notifyIcon1.BalloonTipTitle = "Exhibit"; notifyIcon1.Icon = SystemIcons.Application; - notifyIcon1.ShowBalloonTip(1000); } @@ -94,6 +87,7 @@ public void ConsoleLog(List keys) mouseMoveTimer = false; if (showNotification) { + notifyIcon1.Visible = true; notifyIcon1.BalloonTipTitle = "Exhibit"; notifyIcon1.BalloonTipText = "Last color is: " + textBox1.Text; notifyIcon1.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info; @@ -111,7 +105,7 @@ private void button1_Click(object sender, EventArgs e) private void MouseMoveTimer_Tick_1(object sender, EventArgs e) { - + Point cursor = new Point(); GetCursorPos(ref cursor); var c = GetColorAt(cursor); @@ -405,7 +399,7 @@ private void checkBox1_CheckedChanged(object sender, EventArgs e) } else { - showNotification = false; + showNotification = true; } @@ -415,7 +409,6 @@ private void checkBox1_CheckedChanged(object sender, EventArgs e) private void RunStrip_Click(object sender, EventArgs e) { this.Focus(); - ConsoleLog(C1); this.Show(); @@ -443,5 +436,10 @@ private void notifyIcon1_DoubleClick(object sender, EventArgs e) this.WindowState = FormWindowState.Normal; notifyIcon1.Visible = false; } + + private void textBox1_TextChanged(object sender, EventArgs e) + { + + } } } \ No newline at end of file