title: Why does PostMessage WM_KEYDOWN & WM_KEYUP to textBox produce two characters?
body: <p>I have a form with a multi-line textBox and a button.</p>
  
  <p>The textBox has a Key Up, Down, and Press event so I can see what happens when you press a key.</p>
  
  <p>When I press the <code>a</code> key while the textBox has focus, it shows:</p>
  
  <pre><code>Down: 65
  Press: a
  Up: 65
  </code></pre>
  
  <p>With the button I'm sending a <code>Key Down</code> and <code>Key Up</code> message. With that I get 2 key presses:</p>
  
  <pre><code>Down : 65
  Up : 65
  Press : a
  Press : a
  </code></pre>
  
  <p>Please help me understand why this happens.</p>
  
  <pre><code>        [DllImport("user32.dll")]
      static extern bool PostMessage(IntPtr hWnd, uint Msg, int wParam, int lParam);
  
      const uint WM_KEYDOWN = 0x0100;
      const uint WM_KEYUP = 0x0101;
  
      public Form1()
      {
          InitializeComponent();
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
          PostMessage(textBox1.Handle, WM_KEYDOWN, 65, 0);
          PostMessage(textBox1.Handle, WM_KEYUP, 65, 0);
      }
  
      private void textBox1_KeyDown(object sender, KeyEventArgs e)
      {
          textBox1.AppendText("Down : " + e.KeyValue.ToString() + "\r\n");
      }
  
      private void textBox1_KeyUp(object sender, KeyEventArgs e)
      {
          textBox1.AppendText("Up : " + e.KeyValue.ToString() + "\r\n");
      }
  
      private void textBox1_KeyPress(object sender, KeyPressEventArgs e)
      {
          textBox1.AppendText("Press : " + e.KeyChar.ToString() + "\r\n");
      }
  </code></pre>