aps Posted July 26, 2011 Posted July 26, 2011 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
aps Posted July 28, 2011 Author Posted July 28, 2011 Cntl+TabI 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 ?
Roshith Posted July 28, 2011 Posted July 28, 2011 Try this ControlSend("Window Name", "", "TabControlName", "^{PGDN}")
aps Posted July 29, 2011 Author Posted July 29, 2011 (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 July 29, 2011 by aps
monoscout999 Posted July 30, 2011 Posted July 30, 2011 (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 July 30, 2011 by monoscout999
aps Posted July 30, 2011 Author Posted July 30, 2011 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?
funkey Posted July 30, 2011 Posted July 30, 2011 (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 July 30, 2011 by funkey Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning.
Exit Posted July 30, 2011 Posted July 30, 2011 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()
aps Posted July 30, 2011 Author Posted July 30, 2011 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
aps Posted July 30, 2011 Author Posted July 30, 2011 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.
Exit Posted July 30, 2011 Posted July 30, 2011 Unknown function name.: _GUICtrlTab_ClickTab($ControlHandle,1) ^ ERRORso it cannot find the _GUICtrlTab_ClickTab function. Where can i get that from. Kindly inform. Thanksdid you "#Include <GuiTab.au3>" as first line ? App: Au3toCmd UDF: _SingleScript()
AdmiralAlkex Posted July 30, 2011 Posted July 30, 2011 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) .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface
aps Posted July 30, 2011 Author Posted July 30, 2011 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.
aps Posted July 30, 2011 Author Posted July 30, 2011 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.
aps Posted July 30, 2011 Author Posted July 30, 2011 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.
aps Posted July 30, 2011 Author Posted July 30, 2011 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
aps Posted August 2, 2011 Author Posted August 2, 2011 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now