$hWnd = ControlGetHandle( "Имя окна", "" ,"id" )
_ControlClickEx( $hWnd, "left", 1, 30, 76 )
Func _ControlClickEx( $hWnd, $sButton = "left", $iClicks = 1, $iX = 0, $iY = 0, $iClickDownTime = 0, $iClickDelay = 200 )
Local $User32Dll = DllOpen( "user32.dll" ), $vButton, $Idx, $tPOINT, $pPOINT
; ---
Switch $sButton
Case "middle"
$vButton = 0x04
Case "right"
$vButton = 0x02
Case Else
$vButton = 0x01
EndSwitch
If Not $iX And Not $iY Then
$pPOINT = 0
Else
$tPOINT = DLLStructCreate( $tagPOINT )
DLLStructSetData( $tPOINT, "X", $iX )
DLLStructSetData( $tPOINT, "Y", $iY )
$pPOINT = DllStructGetPtr( $tPOINT )
EndIf
; ---
DllCall( $User32Dll, "long", "PostMessage", "hwnd", $hWnd, "int", 0x02A1, "int", 0, "int", $pPOINT ) ;На счет wParam не уверен.
For $Idx = 1 To $iClicks Step 1
DllCall( $User32Dll, "long", "PostMessage", "hwnd", $hWnd, "int", 0x0100, "int", $vButton, "int", $pPOINT )
If $iClickDownTime Then _
Sleep( $iClickDownTime )
DllCall( $User32Dll, "long", "PostMessage", "hwnd", $hWnd, "int", 0x0101, "int", $vButton, "int", $pPOINT )
If $iClickDelay And $Idx < $iClicks Then _
Sleep( $iClickDelay )
Next
; ---
DllClose( $User32Dll )
EndFunc