Sign in to follow this  
Followers 0
pullmyefinger

A Row of Tabs...

3 posts in this topic

#1 ·  Posted (edited)

was reading over this info on selecting a tab. i did look at control click and the tabs to find something unique to key on, BUT there was nothing unique except the mouse click/position coordinates. Tried this and it did not work at all. malwarebytes anti malware. specifically need the update tab first, then the scanner tab, with items therein.

no text, no control id, all the classnn's are the same, etc. how the heck do i single out one (or two) tabs, do the stuff therein, select another tab and do that stuff?? BAMboozled is a good word from another commenter..

Edited by pullmyefinger

Share this post


Link to post
Share on other sites



And like this ? Posted Image

If not ProcessExists ( 'mbam.exe' ) Then Run ( @ProgramFilesDir & "\Malwarebytes' Anti-Malware\mbam.exe" )

$_Title = "Malwarebytes' Anti-Malware"
WinWait ( $_Title )
$_Handle = WinGetHandle ( $_Title, "" )

For $i = 0 To _ControlTab ( $_Handle, "", "GetTabsCount" )-1
    WinActivate ( $_Handle )
    _ControlTab ( $_Handle, "", "TabRight" )
    Sleep ( 1000 )
Next

Func _ControlTab ( $hWnd, $sText, $iCommand, $iParam1="", $iParam2="", $iParam3="" )
    Local Const $TCM_FIRST = 0x1300
    Local $hTab = ControlGetHandle ( $hWnd, $sText, "SysTabControl322" )
    Switch $iCommand
        Case "GetItemState", "GetItemText", "GetItemImage"
            Local Const $TagTCITEM = "int Mask;int State;int StateMask;ptr Text;int TextMax;int Image;int Param"
            Local Const $TCIF_ALLDATA = 0x0000001B
            Local Const $TCM_GETITEM = $TCM_FIRST + 5
            Local $tBuffer  = DllStructCreate ( "char Text[4096]" )
            Local $pBuffer  = DllStructGetPtr ( $tBuffer )
            Local $tItem    = DllStructCreate ( $tagTCITEM )
            Local $pItem    = DllStructGetPtr ( $tItem )
            DllStructSetData ( $tItem, "Mask", $TCIF_ALLDATA )
            DllStructSetData ( $tItem, "TextMax", 4096 )
            DllStructSetData ( $tItem, "Text", $pBuffer )
            If $iParam1 = -1 Then $iParam1 = _ControlTab ( $hWnd, $sText, "CurrentTab" )
            DllCall ( "user32.dll", "long", "SendMessage", "hwnd", $hTab, "int", $TCM_GETITEM, "int", $iParam1, "int", $pItem )
            If @error Then Return SetError ( 1, 0, "" )
            If $iCommand = "GetItemState" Then Return DllStructGetData ( $tItem, "State" )
            If $iCommand = "GetItemText" Then Return DllStructGetData ( $tBuffer, "Text" )
            If $iCommand = "GetItemImage" Then Return DllStructGetData ( $tItem, "Image" )
        Case "CurrentTab", "TabRight", "TabLeft"
            Local $iRet = ControlCommand ( $hWnd, $sText, "SysTabControl322", $iCommand, "" )
            If @error Then Return SetError ( 1, 0, -1 )
            Return $iRet - 1
        Case "GetTabsCount"
            Local Const $TCM_GETITEMCOUNT = $TCM_FIRST + 4
            Local $iRet = DllCall ( "user32.dll", "long", "SendMessage", "hwnd", $hTab, "int", $TCM_GETITEMCOUNT, "int", 0, "int", 0 )
            If @error Then Return SetError ( 1, 0, -1 )
            Return $iRet[0]
        Case "FindTab"
            If Not IsNumber ( $iParam2 ) Or $iParam2 < 0 Then $iParam2 = 0
            Local $sTabText
            For $i = $iParam2 To _ControlTab ( $hWnd, $sText, "GetTabsCount" )
                $sTabText = _ControlTab ( $hWnd, $sText, "GetItemText", $i )
                If $iParam3 = True And StringInStr ( $sTabText, $iParam1 ) Then Return $i
                If $sTabText = $iParam1 Then Return $i
            Next
            Return -1
        Case Else
            Return SetError ( 2, 0, "" )
    EndSwitch
EndFunc

AutoIt 3.3.14.2 X86 - SciTE 3.6.0WIN 8.1 X64 - Other Example Scripts

Share this post


Link to post
Share on other sites

was reading over this info on selecting a tab. i did look at control click and the tabs to find something unique to key on, BUT there was nothing unique except the mouse click/position coordinates. Tried this and it did not work at all. malwarebytes anti malware. specifically need the update tab first, then the scanner tab, with items therein.

no text, no control id, all the classnn's are the same, etc. how the heck do i single out one (or two) tabs, do the stuff therein, select another tab and do that stuff?? BAMboozled is a good word from another commenter..

That's good, but in looking for features I found NO _ControlTab Function or anything having to do with it. I need to know how this works in order to mess with what was given..

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