title: What is a proper way to send a click using winapi messages?
body: <p>Once you have a <code>hwnd</code> handle for a windows window, you can make it think that user pressed mouse button down using <code>SendMessage(hwnd, WM_LBUTTONDOWN, 0, 0)</code>.</p>
  
  <p>I assumed that click is sent by sending mouse down and mouse up message:</p>
  
  <pre><code>  @Override
    public void click(int x, int y, MouseButton button, boolean isControl, boolean isAlt, boolean isShift) {
      mouseDown(x, y, button, isControl, isAlt, isShift);
      mouseUp(x, y, button, isControl, isAlt, isShift);
    }
  </code></pre>
  
  <p>But sometimes this ends up highlighting the item I wanted to use instead of activating the click event. Am I doing it wrong in general, or is it because some applications apply extra logic to click event?</p>