Opened 15 years ago

Closed 15 years ago

#674 closed Bug (Fixed)

_GUICtrlTab_ClickTab() Clicks in the wrong place when $fMove = True

Reported by: Bowmore Owned by: Gary
Milestone: Component: Standard UDFs
Version: Severity: Blocking
Keywords: Cc:


Win XP Pro SP2
Autoit Beta

If the $fMove option is set to True the mouse is moved to the wrong location when the window is not maximised. In the code below I've added the 2 highlighted lines to temporarily change the "MouseCoordMode" move the curusor and then reset "MouseCoordMode" to what it was. I've tested this on a few different scenarios and it works OK for me.

Func _GUICtrlTab_ClickTab($hWnd, $iIndex, $sButton = "left", $fMove = False, $iClicks = 1, $iSpeed = 1)
	Local $iX, $iY, $tPoint, $tRect, $iMode, $aPos
	If $Debug_TAB Then _GUICtrlTab_ValidateClassName($hWnd)
	If Not IsHWnd($hWnd) Then $hWnd = GUICtrlGetHandle($hWnd)
	$tRect = _GUICtrlTab_GetItemRectEx($hWnd, $iIndex)
	$tPoint = _WinAPI_PointFromRect($tRect, True)
	$tPoint = _WinAPI_ClientToScreen($hWnd, $tPoint)
	_WinAPI_GetXYFromPoint($tPoint, $iX, $iY)
	ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iX = ' & $iX & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
	ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : $iY = ' & $iY & @crlf & '>Error code: ' & @error & @crlf) ;### Debug Console
	If Not $fMove Then
		$iMode = Opt("MouseCoordMode", 1)
		$aPos = MouseGetPos()
		Opt("MouseCoordMode", $iMode)
		MouseClick($sButton, $iX, $iY, $iClicks, $iSpeed)
		MouseMove($aPos[0], $aPos[1], 0)
		$iMode = Opt("MouseCoordMode", 1) ;;ADDED THIS LINE
		MouseClick($sButton, $iX, $iY, $iClicks, $iSpeed)
		Opt("MouseCoordMode", $iMode) ;;ADDED THIS LINE
EndFunc   ;==>_GUICtrlTab_ClickTab

Attachments (0)

Change History (4)

comment:1 Changed 15 years ago by Valik

  • Severity changed from None to Blocking

comment:2 Changed 15 years ago by TicketCleanup

  • Severity changed from Blocking to None

Automatic ticket cleanup.

comment:3 Changed 15 years ago by Valik

  • Severity changed from None to Blocking
  • Status changed from new to assigned

comment:4 Changed 15 years ago by Gary

  • Milestone set to
  • Resolution set to Fixed
  • Status changed from assigned to closed

Fixed in version:

Guidelines for posting comments:

  • You cannot re-open a ticket but you may still leave a comment if you have additional information to add.
  • In-depth discussions should take place on the forum.

For more information see the full version of the ticket guidelines here.

Add Comment

Modify Ticket

as closed The owner will remain Gary.

E-mail address and user name can be saved in the Preferences.

Note: See TracTickets for help on using tickets.