title: win32: simulate a click without simulating mouse movement?
body: <p>I'm trying to simulate a mouse click on a window. I currently have success doing this as follows (I'm using Python, but it should apply to general win32):</p>
  
  <pre><code>win32api.SetCursorPos((x,y))
  win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,0,0)
  win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,0,0)
  </code></pre>
  
  <p>This works fine. However, if the click happens while I'm moving the mouse manually, the cursor position gets thrown off. Is there any way to send a click directly to a given <code>(x,y)</code> coordinate without moving the mouse there? I've tried something like the following with not much luck:</p>
  
  <pre><code>nx = x*65535/win32api.GetSystemMetrics(0)
  ny = y*65535/win32api.GetSystemMetrics(1)
  win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN | \
                       win32con.MOUSEEVENTF_ABSOLUTE,nx,ny)
  win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP | \
                       win32con.MOUSEEVENTF_ABSOLUTE,nx,ny)
  </code></pre>