title: Virtual mouse click c#
body: <p>I have an multithreaded application that needs to be able to preform multiple mouse click at the same time.</p>
  
  <p>I have an <code>IntPtr intptr</code> to a process on which i need to send a mouse click to.
  I have tried to find this information on the web and there are some examples which i have tried. But I have not got any of them to work.</p>
  
  <p>As I understand the correct way to solv my issue is to use the function 
  <code>SendMessage(IntPtr hWnd, int Msg, IntPtr wParam, IntPtr lParam);</code></p>
  
  <p>hWnd is the IntPtr to the process.
  Msg is the wanted action, which I want a left click, <code>int WM_LBUTTONDBLCLK = 0x0203;</code>
  IntPtr wParam is of no intrest to this problem ( as I understand) 
  And the coordinates to the click is in lParam.
  I construct lParam like,</p>
  
  <pre><code>Int32 word = MakeLParam(x, y);
  
  private int MakeLParam(int LoWord, int HiWord)
       {
           return ((HiWord &lt;&lt; 16) | (LoWord &amp; 0xffff));
       }
  </code></pre>
  
  <p>But as you might understand, I cant get this to work.
  My first question is, the coordinates are they within the window of this process or are 
  the absolut screen coordinates?
  And my second question, what am I doing wrong?</p>