Sign in to follow this  
Followers 0
Shibuya

Clicking accurately on a SysTabControl32

7 posts in this topic

Hi peeps,

I'm trying to get a command that clicks on a particular tab of a SysTabControl32

Hoping to do it without using mouse coordinate clicks, or tabbing thru the other tabs which i need not access

I'd like to do it like the ControlCommand - SetCurrentSelection, which i believe it is not supported for tabs?


The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!"

Share this post


Link to post
Share on other sites



Look at the CurrentTab, TabLeft, and TabRight commands for the ControlCommand function.

Unfortunately, there is no MoveToTab command.


[font="Tahoma"]"Tougher than the toughies and smarter than the smarties"[/font]

Share this post


Link to post
Share on other sites

I've already looked at that command before comming to the forums

unfortunately, using TabLeft or TabRight would do the same thing as tabbing thru all the other tabs which I woun't want to access


The speed of sound is defined by the distance from door to computer divided by the time interval needed to close the media player and pull up your pants when your mom shouts "OH MY GOD WHAT ARE YOU DOING!!!"

Share this post


Link to post
Share on other sites

You are not able to get to a tab using autoit without tabbing through others. Even then, there is no harm to the target program in clickin another tab before reaching the one you want.


Who else would I be?

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Global $TCM_SETCURFOCUS = 0x1330
Global $TCM_SETCURSEL = 0x130C

Run(@ComSpec & " /c start " & @SystemDir & "\inetcpl.cpl")
If WinWaitActive("Internet Properties") Then
    $nTabIndex = 4
    $hWnd = ControlGetHandle("Internet Properties", "", "SysTabControl321")
    DllCall("user32.dll", "int", "SendMessage", _
        "hwnd", $hWnd, _
        "int", $TCM_SETCURFOCUS, _
        "int", $nTabIndex, _
        "long", 0)   
    DllCall("user32.dll", "int", "SendMessage", _
        "hwnd", $hWnd, _
        "int", $TCM_SETCURSEL, _
        "int", $nTabIndex, _
        "long", 0)
EndIf

Edited by SumTingWong

Share this post


Link to post
Share on other sites

Global $TCM_SETCURFOCUS = 0x1330
Global $TCM_SETCURSEL = 0x130C

Run(@ComSpec & " /c start " & @SystemDir & "\inetcpl.cpl")
If WinWaitActive("Internet Properties") Then
    $nTabIndex = 4
    $hWnd = ControlGetHandle("Internet Properties", "", "SysTabControl321")
    DllCall("user32.dll", "int", "SendMessage", _
        "hwnd", $hWnd, _
        "int", $TCM_SETCURFOCUS, _
        "int", $nTabIndex, _
        "long", 0)   
    DllCall("user32.dll", "int", "SendMessage", _
        "hwnd", $hWnd, _
        "int", $TCM_SETCURSEL, _
        "int", $nTabIndex, _
        "long", 0)
EndIf
Does not work with creative x-fi "audio console". it does change the tab, but all controls are disabled or if it is a listbox it is empty

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Hi, look at http://www.autoitscript.com/forum/index.ph...c=42400&hl=

Toggle option show pictures on IE propierties using TreeView functions in AutoItLib3 package is something like :

#include <A3LMenu.au3>

#include <A3LTreeView.au3>

Global $hTree

$WinProp = "Internet Properties"

$nodo = "Show pictures"

Run("control.exe inetcpl.cpl,,6","",@SW_HIDE)

WinWait($WinProp)

$hTree = ControlGetHandle($WinProp, "", "SysTreeView321")

if @Error then _Lib_ShowError("Unable to find TreeView window")

$hNode = _TreeView_FindNode($hTree, $nodo)

If _TreeView_GetChecked($hTree, $hNode) Then

_TreeView_SetChecked($hTree, $hNode, False)

MsgBox(0,"","Unsetting Show pictures option")

Else

_TreeView_SetChecked($hTree, $hNode)

MsgBox(0,"","Setting Show pictures option")

EndIf

$verIE = StringMid(RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer", "Version"),1,1)

If $verIE = 6 Then

ControlClick($WinProp, "", "[CLASS:Button; INSTANCE:4]")

ControlClick($WinProp, "", "[CLASS:Button; INSTANCE:2]")

Else ;;; IE Version 7

ControlClick($WinProp, "", "[CLASS:Button; INSTANCE:3]")

ControlClick($WinProp, "", "[CLASS:Button; INSTANCE:5]")

EndIf

Hope this help you...

Eduardo.

Edited by Eduardo

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