Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #RequireAdmin
- ;Trunghieuth10 - http://facebook.com/trunghieuth10
- #include <WinAPI.au3>
- Global Const $API_MOUSEMOVE = 0x200
- Global Const $API_LBUTTONDOWN = 0x201
- Global Const $API_LBUTTONUP = 0x202
- Global Const $API_MBUTTONDOWN = 0x207
- Global Const $API_MBUTTONUP = 0x208
- Global Const $API_RBUTTONDOWN = 0x204
- Global Const $API_RBUTTONUP = 0x205
- Global Const $API_NCLBUTTONDOWN = 0xA1
- Global Const $API_LBUTTONDBLCLK = 0x203
- Global Const $API_MBUTTONDBLCLK = 0x209
- Global Const $API_RBUTTONDBLCLK = 0x206
- Global Const $API_LBUTTON = 0x1
- Global Const $API_MBUTTON = 0x10
- Global Const $API_RBUTTON = 0x2
- Global Const $API_SETREDRAW = 0xB
- Global Const $API_ERASEBKGND = 0x14
- Const $API_CONTROL = 0x8
- Func _MouseClick_WinAPI($hwnd, $x=0, $y=0, $button='Left', $click = 1)
- $lParam = ($y * 65536) + ($x)
- For $k = 1 To $click
- Switch $button
- Case $button='Left'
- _WinAPI_PostMessage($hwnd, $API_LBUTTONDOWN, $API_LBUTTON,$lParam)
- _WinAPI_PostMessage($hwnd, $API_LBUTTONUP, 0,$lParam)
- Case $button='Left Double'
- _WinAPI_PostMessage($hwnd, $API_LBUTTONDOWN, $API_LBUTTON,$lParam)
- _WinAPI_PostMessage($hwnd, $API_LBUTTONUP, 0,$lParam)
- _WinAPI_PostMessage($hwnd, $API_LBUTTONDBLCLK, $API_LBUTTON,$lParam)
- _WinAPI_PostMessage($hwnd, $API_LBUTTONUP, 0,$lParam)
- Case $button='Middle'
- _WinAPI_PostMessage($hwnd, $API_MBUTTONDOWN, $API_MBUTTON,$lParam)
- _WinAPI_PostMessage($hwnd, $API_MBUTTONUP, 0,$lParam)
- Case $button='Middle Double'
- _WinAPI_PostMessage($hwnd, $API_MBUTTONDOWN, $API_MBUTTON,$lParam)
- _WinAPI_PostMessage($hwnd, $API_MBUTTONUP, 0,$lParam)
- _WinAPI_PostMessage($hwnd, $API_MBUTTONDBLCLK, $API_MBUTTON,$lParam)
- _WinAPI_PostMessage($hwnd, $API_MBUTTONUP, 0,$lParam)
- Case $button='Right'
- _WinAPI_PostMessage($hwnd, $API_RBUTTONDOWN, $API_RBUTTON,$lParam)
- _WinAPI_PostMessage($hwnd, $API_RBUTTONUP, 0,$lParam)
- Case $button='Right Double'
- _WinAPI_PostMessage($hwnd, $API_RBUTTONDOWN, $API_RBUTTON,$lParam)
- _WinAPI_PostMessage($hwnd, $API_RBUTTONUP, 0,$lParam)
- _WinAPI_PostMessage($hwnd, $API_RBUTTONDBLCLK, $API_RBUTTON,$lParam)
- _WinAPI_PostMessage($hwnd, $API_RBUTTONUP, 0,$lParam)
- Case $button='Move'
- _WinAPI_PostMessage($hwnd, $API_MOUSEMOVE, 0,$lParam)
- _WinAPI_PostMessage($hwnd, $API_MOUSEMOVE, 0,$lParam)
- EndSwitch
- Next
- EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement