Sign in to follow this  
Followers 0
AnHo

Clicking a Tab in AutoIT version 3.2.10

9 posts in this topic

I had used the function _Tab_ClickTab() in version 3.2.9 to click on a Tab. That function is no longer available in version 3.2.10. Could someone suggest an alternative for _Tab_ClickTab() in version 3.2.10? thanks.

Share this post


Link to post
Share on other sites



I had used the function _Tab_ClickTab() in version 3.2.9 to click on a Tab. That function is no longer available in version 3.2.10. Could someone suggest an alternative for _Tab_ClickTab() in version 3.2.10? thanks.

That function is in A3LTabControl.au3

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

That function is in A3LTabControl.au3

Well, yes in version 3.2.9 not 3.2.10, hence my question!

Share this post


Link to post
Share on other sites

Well, yes in version 3.2.9 not 3.2.10, hence my question!

I don't know that there is a replacement for it but you could still use A3LTab.au3 although you might need to make some changes.

Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

What about _GUICtrlTab_SetCurFocus ?

Share this post


Link to post
Share on other sites

Well, yes in version 3.2.9 not 3.2.10, hence my question!

It was never a part of the AutoIt install.


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

If you really think you need the function this should do what you want:

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)
    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
        MouseClick($sButton, $iX, $iY, $iClicks, $iSpeed)
    EndIf
EndFunc   ;==>_GUICtrlTab_ClickTab

SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

If you really think you need the function this should do what you want:

Gary, reading your reply, perhaps you have a better way to do this?

Share this post


Link to post
Share on other sites

This is the same as in old A3L, but with only one Func

CODE
; #FUNCTION# ====================================================================================================

================

; Description ...: Clicks a tab

; Parameters ....: $hWnd - Handle to control

; $iIndex - Specifies the zero based index of the item

; $fButton - Button to click with

; $fMove - If True, the mouse will be moved. If False, the mouse does not move.

; $iClicks - Number of clicks

; $iSpeed - Mouse movement speed

; $fPopupScan - If True, a popup scan will be done after the click

; Return values .:

; Author ........: Paul Campbell (PaulIA)

; Remarks .......:

; Related .......:

; ====================================================================================================

===========================

Func _Tab_ClickTab($hWnd, $iIndex, $sButton="left", $fMove=False, $iClicks=1, $iSpeed=0, $fPopupScan=False)

Local $iX, $iY, $tPoint, $tRect

$tRect = _Tab_GetItemRectEx($hWnd, $iIndex)

$tPoint = _Lib_PointFromRect($tRect)

$tPoint = _API_ClientToScreen($hWnd, $tPoint)

_Lib_GetXYFromPoint($tPoint, $iX, $iY)

_Lib_MouseClick($sButton, $iX, $iY, $fMove, $iClicks, $iSpeed, $fPopupScan)

EndFunc

; #FUNCTION# ====================================================================================================

================

; Description ...: Click one of the mouse buttons

; Parameters ....: $sButton - Button to click

; $iX - X position

; $iY - Y position

; $fMove - If True, the mouse will be moved. If False, the mouse does not move.

; $iClicks - Number of clicks

; $iSpeed - Mouse movement speed

; Return values .:

; Author ........: Paul Campbell (PaulIA)

; Remarks .......: This function is used to centralize the events surrounding an Auto3Lib mouse click. It wraps the AutoIt mouse

; click function with the ability to consider the MouseCoordMode flag and scan for popup windows after the mouse

; click.

; Related .......: _Lib_MouseMove

; ====================================================================================================

===========================

Func _Lib_MouseClick($sButton, $iX, $iY, $fMove=False, $iClicks=1, $iSpeed=0, $fPopupScan=False)

Local $iMode, $tPoint, $sClass

$iMode = Opt("MouseCoordMode", 1)

if $fMove then

MouseClick($sButton, $iX, $iY, $iClicks, $iSpeed)

if $fPopupScan then _Lib_PopupScan()

else

$tPoint = _Lib_GetMousePos()

_API_ShowCursor(False)

MouseClick($sButton, $iX, $iY, $iClicks, $iSpeed)

if $fPopupScan then

_Lib_PopupScan()

if _Lib_PopupCount() > 0 then

$sClass = _API_GetClassName(_API_WindowFromPoint($tPoint))

$fMove = ($sClass = "#32768") or ($sClass = "ToolbarWindow32")

endif

endif

if not $fMove then

$iX = DllStructGetData($tPoint, "X")

$iY = DllStructGetData($tPoint, "Y")

MouseMove($iX, $iY, 0)

endif

_API_ShowCursor(True)

endif

Opt("MouseCoordMode", $iMode)

EndFunc


*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0