title: C# KEYEVENTF_KEYUP doesn't work in specific app
body: <p>I need to emulate some keys, here the code:</p>
  
  <pre><code>[DllImport("user32.dll")]
  private static extern void keybd_event(byte bVk, byte bScan, int dwFlags, int dwExtraInfo);
  
  private const int KEYEVENTF_EXTENDEDKEY = 1;
  private const int KEYEVENTF_KEYUP = 2;
  
  public static void KeyDown(Keys vKey)
  {
      keybd_event((byte)vKey, 0, KEYEVENTF_EXTENDEDKEY, 0);
  }
  
  public static void KeyUp(Keys vKey)
  {
      keybd_event((byte)vKey, 0, KEYEVENTF_EXTENDEDKEY | KEYEVENTF_KEYUP, 0);
  }
  
  KeyboardSend.KeyDown(Keys.Z);
  KeyboardSend.KeyUp(Keys.Z);
  </code></pre>
  
  <p>But in one specific application "KeyUp" method doesn't work and is depressed until i press key on keyboard.</p>
  
  <p>What i'm doing wrong?</p>