Jump to content

Recommended Posts

Posted

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

Posted

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 ?
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
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
Posted

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?

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.

Posted

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)

App: Au3toCmd              UDF: _SingleScript()                             

Posted

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

Posted

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.

Posted

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 ?

App: Au3toCmd              UDF: _SingleScript()                             

Posted

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)

Posted

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.

Posted

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.

Posted

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.

Posted

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

Posted

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

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...