title: simulate selection in windows C++
body: <p>I have this in my Notepad:</p>
  <pre><code>hello
  </code></pre>
  <p>I want to simulate selecting in C++ using Windows' <code>keybd_event</code> function.
  here is my code:</p>
  <pre class="lang-cpp prettyprint-override"><code>keybd_event(VK_SHIFT, 0, 0, 0);
  for (size_t i = 0; i &lt; 5; i++)
  {
      keybd_event(VK_LEFT, 0, 0, 0);
      keybd_event(VK_LEFT, 0, KEYEVENTF_KEYUP, 0);
  }
  keybd_event(VK_SHIFT, 0, KEYEVENTF_KEYUP, 0);
  </code></pre>
  <p>but after I run this, it didn't select anything, it just go to the start of the file. Why isn't this working?</p>