title: Simulate mouse click using PostMessage
body: <p>More recently, simulating a click using PostMessage has begun to activate the window. Previously, this was not and the click was performed in an inactive window without focus.</p>
  
  <pre><code>int coords = (y &lt;&lt; 16) + x;
  IntPtr lParam = new IntPtr(coords);
  PostMessage(hwnd, WM_LBUTTONDOWN, IntPtr.Zero, lParam);
  PostMessage(hwnd, WM_LBUTTONUP, IntPtr.Zero, lParam);
  
  [DllImport("user32.dll", SetLastError = true)]
  static extern bool PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
  
  const Int32 WM_LBUTTONDOWN = 0x201;
  const Int32 WM_LBUTTONUP = 0x202;
  </code></pre>