title: How Do I Use SendInput in Delphi?
body: <p>I was using the <code>Mouse_Event</code> Function in Delphi 2009, but the Delphi documentation says this function has been superceded and to use <code>SendInput</code> instead.</p>
  
  <p>The Delphi <code>SendInput</code> documentation defines the syntax and parameters, but there are no examples and it is not clear how to use the function. I've looked around on the web, and can't find any good Delphi examples. </p>
  
  <p>Specifically, I am trying to simulate the left mouse down and then up. Currently I do this with <code>Mouse_Event</code> as follows:</p>
  
  <pre><code>    Mouse_Event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
      Mouse_Event(MOUSEEVENTF_ABSOLUTE or MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
  </code></pre>
  
  <p>How would I do this using <code>SendInput</code>?</p>
  
  <hr>
  
  <p>Followup:</p>
  
  <p>I ended up leaving my code as is as @David suggested.</p>
  
  <p>But I gave @opc0de the answer since he did give an answer to my question. However, I can't vouch that it is correct, because I never did try it.</p>