Emulating a mouseclick using PostMessage
<p>I am using python's win32 module to create a simple click() method, which should emulate a mouse click, but unfortunately my approach is not working.</p>

<pre><code>def click(x, y):
    hWnd = win32gui.FindWindow(None, "SomeWindowTitle")
    lParam = win32api.MAKELONG(x, y)

    win32gui.PostMessage(hWnd, WM_LBUTTONDOWN, MK_LBUTTON, lParam);
    win32gui.PostMessage(hWnd, WM_LBUTTONUP, MK_LBUTTON, lParam);

...
timer = Timer(30, click, [x, y])
timer.start()
</code></pre>

<p>I am thankful for every hint!</p>