Sign in to follow this  
Followers 0
aps

TABS

22 posts in this topic

hi all

i have a problem. when i use controlgettext to get the title of a tabbed window, i get it correctly. for example I have 2 tabs in a window. TAB-A and TAB-B. How can i go from one TAB to the next TAB window using Control commands. Please can anyone explain. thanks

Share this post


Link to post
Share on other sites



Cntl+Tab

I want to control the tab using control commands and not using the keyborad commands. is there any way ? i am sure there shud be one. Anyone ?

Share this post


Link to post
Share on other sites

Try controlclick

Share this post


Link to post
Share on other sites

Try this

ControlSend("Window Name", "", "TabControlName", "^{PGDN}")

Share this post


Link to post
Share on other sites

ControlFocus?

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

ok guys. Thanks for the help but things are not working still. SO Here's a small snippet that should work but is not working. For anyone who likes to solve faulty code and get it worrking here is a nice problem.

I have actually written a small piece of code snippet that should work but is not. This code uses the AUTOIT HELP WINDOW in this example below. What this code tries to do is to try and control or rather just click, using ControlClick, on a tab of autoit help window to switch to it.

So the Autoit help window is open with Tab Contents selected and this code should help to click on the Tab Index and change the list view accordingly.

Here's the code :

$scr_win = WinActivate("[TITLE:AutoIt Help;CLASS:HH Parent]", "")

if $scr_win = 1

Then

ControlClick "[TITLE:AutoItHelp;CLASS:HHParent]","","[sysTabControl32]",1,75,10)

MsgBox(0, "Text is : ", "HI")

EndIf

Edited by aps

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Don`t open a another thread with the same subject..

anyway you need to learn more before. that code that you post is not well spelled. i correct it for you, but you need to learn the basics first. and next time use autoit tags when you post an autoit code

[/autoit]
[autoit]$scr_win = WinActivate("[TITLE:AutoIt Help;CLASS:HH Parent]", "")
if $scr_win = 1 Then
    ControlClick ("[TITLE:AutoItHelp;CLASS:HHParent]","","[class:SysTabControl32]",1,75,10)
EndIf
Edited by monoscout999

Share this post


Link to post
Share on other sites

Thanks Monoscout for all the information. I'll keep in mind for next. However, the code that you edited and gave me, the class tag was missing in controlID - which does not really make any difference.

So i tried your modified code but the Tab still does not change so that means that the code is not working and does not change the TAB that it is supposed to do. Can you or anyone else get this code working. I'll put the code here again with the autoit Tags this time

This code should work with the AutoIt Help file open but does not. WHY??

$scr_win = WinActivate("[TITLE:AutoIt Help;CLASS:HH Parent]", "")
if $scr_win = 1 Then
    ControlClick ("[TITLE:AutoItHelp;CLASS:HHParent]","","[class:SysTabControl32]",1,75,10)
EndIf

Why is the controlClick not sending a click to the Index TAB on the AutoIt help window?

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

Have a look at _GUICtrlTab_SetCurSel. SendMessage is used to change the tab.

Edit: Added example

#Include <SendMessage.au3>
Local $hCtrl = ControlGetHandle("AutoIt Help","","SysTabControl321")
For $i = 0 To 3
 _SendMessage($hCtrl, 0x1300 + 12, $i)
 Sleep(1000)
Next
Edited by funkey

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post


Link to post
Share on other sites

I want to control the tab using control commands and not using the keyborad commands. is there any way ? i am sure there shud be one. Anyone ?

Then use this:

#Include <GuiTab.au3>
ShellExecute(@ProgramFilesDir & "\AutoIt3\AutoIt3Help.exe")
$WindowHandle = WinWait("[TITLE:AutoIt Help;CLASS:HH Parent]", "", 5)
If Not $WindowHandle Then Exit MsgBox(262144, "", @LF & "AutoIt help window not found" & @LF, 0)
$ControlHandle = ControlGetHandle($WindowHandle,"","SysTabControl321")
_GUICtrlTab_ClickTab($ControlHandle,1)

My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post


Link to post
Share on other sites

ok Forumer, thanks for the piece of code. however the last line gives an error and says that as below :

Unknown function name.:

_GUICtrlTab_ClickTab($ControlHandle,1)

^ ERROR

so it cannot find the _GUICtrlTab_ClickTab function. Where can i get that from. Kindly inform. Thanks

Share this post


Link to post
Share on other sites

hi funkey, thanks for this help. but i am getting the following error.

Error opening the file.:

#Include <SendMessage.au3>

I have checked the #include files but not found the SendMessage.au3 anywhere. What do i do ?

Please help.

Share this post


Link to post
Share on other sites

Unknown function name.:

_GUICtrlTab_ClickTab($ControlHandle,1)

^ ERROR

so it cannot find the _GUICtrlTab_ClickTab function. Where can i get that from. Kindly inform. Thanks

did you "#Include <GuiTab.au3>" as first line ?

My UDFs, Abbrevs and Snippets
If you like my post, just click the like button :) 

Share this post


Link to post
Share on other sites

hi funkey, thanks for this help. but i am getting the following error.

Error opening the file.:

#Include <SendMessage.au3>

I have checked the #include files but not found the SendMessage.au3 anywhere. What do i do ?

Please help.

Have you not updated AutoIt since you joined the forum? :)

3.2.11.0 (25th January, 2008)

UDFs:

Moved: _SendMessage, _SendMessageA from Misc.au3 to SendMessage.au3 (Gary Frost)

Share this post


Link to post
Share on other sites

hi foremur. yes i included that. I copy pasted your code. could it be that its cos i have maybe an older version of AutoIt ?. I have the version v3.2.4.9 as indicated by the help file of AutoIt. Kindly advise what i should do now.

Share this post


Link to post
Share on other sites

Thanks AdmiralManHairAlkex ! I think thats the problem. I have not updated it so far. I'll do it now - if i can find it that is. lol. Thanks so much. I think that should answer both my questions.

Share this post


Link to post
Share on other sites

hi forumer ! your code worked !! so thanks loads ! But now if u can answer my small question that why does control click not work directly with this, I would be grateful. I thought ControlClick would have been so simpler.

Thanks.

Share this post


Link to post
Share on other sites

Hi funkey ! thanks ! your code is working as well. Thanks loads. Where i had no way, I have found two. I am elated. But if someone can use controlclick to do the same that wud be great or enlighten me why it cannot be used.

Thanks again

Share this post


Link to post
Share on other sites

ok ! thanks all. The code finally works after i upgraded. Just one last question on this topic. What is the use of the function ControlClick & how & where can it be used.

Thanks

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