title: Activate windows "Alt Tab" switcher with SendInput
body: <p>I need to show the windows switcher with <code>SendInput</code>.  <a href="https://stackoverflow.com/questions/31604420/how-to-change-key-state-in-windows-without-sendinput">Another question</a> I asked explains the reason of doing this.  Shortly speaking, when I am holding <code>Alt Tab</code> to switch to other apps, my app may fire a key stroke using <code>SendInput</code>, which will interrupt current switcher, and this is why I need to refire a <code>Alt Tab</code>.  Currently I am working on posting another <code>tab</code> key stroke (I am still holding alt when switching) or the entirely <code>alt down + tab down &amp; up</code>. But with alt holding, a single tab stroke sent by SendInput will not trigger the switcher. And the entire combined key does not work neither. Here's some test code.</p>
  
  <pre><code>#include &lt;windows.h&gt;
  #include &lt;WinUser.h&gt;
  #include &lt;iostream&gt;
  
  
  int main(void) {
      Sleep(1000 * 3);
      INPUT tabinput[2];
      tabinput[0].type = INPUT_KEYBOARD;
      tabinput[0].ki = {0x09, 0}; // KEY_TAB = 0x09
      tabinput[1].type = INPUT_KEYBOARD;
      tabinput[1].ki = {0x09, 0, KEYEVENTF_KEYUP};
      SendInput(2, tabinput, sizeof(INPUT));
      getchar();
  }
  </code></pre>
  
  <p>I'm trying to fire a tab key stroke delayed 3s. I'am holding the alt key. This doesn't work. But the tab key is triggered, because When I run this code and switch to a text editor or something, there will be a tab event. My system is <code>win8.1 64bit</code>. </p>