|
楼主 |
发表于 2017-2-9 11:26:06
|
显示全部楼层
看一下这个_MouseClick() 里面是怎么写的。
1361739590 发表于 2017-2-8 09:08
Func _MouseClick($hWnd, $x, $y, $button = 'left', $times = 1, $delay = 250)
Local $ix
Local $lParam = BitOR(BitAND($x, 0xFFFF), $y * 0x10000)
$button = StringLower($button)
If $button = "left" Then
For $ix = 1 To $times
_PostMessage($hWnd, 0x200, 0, $lParam);WM_MOUSEMOVE
_PostMessage($hWnd, 0x201, 1, $lParam);WM_LBUTTONDOWN
_PostMessage($hWnd, 0x202, 0, $lParam);WM_LBUTTONUP
If $ix < $times Then Sleep($delay)
Next
ElseIf $button = "right" Then
For $ix = 1 To $times
_PostMessage($hWnd, 0x200, 0, $lParam);WM_MOUSEMOVE
_PostMessage($hWnd, 0x204, 2, $lParam);WM_RBUTTONDOWN
_PostMessage($hWnd, 0x205, 0, $lParam);WM_RBUTTONUP
If $ix < $times Then Sleep($delay)
Next
EndIf
EndFunc ;==>_MouseClick
Func _PostMessage($hWnd, $iMsg, $iwParam, $ilParam)
DllCall("user32.dll", "bool", "PostMessage", "hwnd", $hWnd, "uint", $iMsg, "wparam", $iwParam, "lparam", $ilParam)
EndFunc ;==>_WinAPI_PostMessage |
|