#include <WindowsConstants.au3>
Local $Button = $WM_LBUTTONDOWN
;Local $Button = $WM_RBUTTONDOWN
;Local $Button = $WM_MBUTTONDOWN
Local $Delay = 100
DllCall("user32.dll", "bool", "PostMessage", "hwnd", $hWnd, "int", $Button, "int", "0", "long", _MakeLong($X, $Y))
Sleep($Delay)
DllCall("user32.dll", "bool", "PostMessage", "hwnd", $hWnd, "int", $Button + 1, "int", "0", "long", _MakeLong($X, $Y))
Func _MakeLong($LoDWORD, $HiDWORD) ;WinAPI.au3
Return BitOR($HiDWORD * 0x10000, BitAND($LoDWORD, 0xFFFF))
EndFunc