﻿id	summary	reporter	owner	description	type	status	milestone	component	version	severity	resolution	keywords	cc
674	_GUICtrlTab_ClickTab() Clicks in the wrong place when $fMove = True	Bowmore	Gary	"'''Enviroment:'''
Win XP Pro SP2
Autoit 3.2.12.1
Autoit 3.2.13.10 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)
		_WinAPI_ShowCursor(False)
		MouseClick($sButton, $iX, $iY, $iClicks, $iSpeed)
		MouseMove($aPos[0], $aPos[1], 0)
		_WinAPI_ShowCursor(True)
	Else
		$iMode = Opt(""MouseCoordMode"", 1) ;;ADDED THIS LINE
		MouseClick($sButton, $iX, $iY, $iClicks, $iSpeed)
		Opt(""MouseCoordMode"", $iMode) ;;ADDED THIS LINE
	EndIf
EndFunc   ;==>_GUICtrlTab_ClickTab
}}}"	Bug	closed	3.2.13.11	Standard UDFs	3.2.13.10	Blocking	Fixed		
