mmillar Posted February 14, 2006 Posted February 14, 2006 (edited) Hi, I'm trying to automate the collection of some information in the properties window of a third-party program. The properties window has eight tabs and when you open it you don't know which of the eight tabs you will be on. The information I want is on the General tab. At the moment I can use... $a = ControlGetFocus("Indicator Properties - test") ...and I know that if I'm on the General tab then $a will be 'Edit1'. If it isn't I send a Ctrl-PgUp (to move to the next tab) and try again. This seems a bit slow and cumbersome and I wondered if there was an easier/better way to get straight to the General tab. Thanks for any help. Edited February 14, 2006 by mmillar
dabus Posted February 14, 2006 Posted February 14, 2006 Have a look at ControlCommand ( "title", "text", controlID, "command", "option" ) and specific Command, Option Return Value "CurrentTab", "" Returns the current Tab shown of a SysTabControl32 "TabRight", "" Moves to the next tab to the right of a SysTabControl32 "TabLeft", "" Moves to the next tab to the left of a SysTabControl32 Maybe you could use TabLeft until CurrentTab is General.
mmillar Posted February 14, 2006 Author Posted February 14, 2006 (edited) Hi dabus, Thanks for your reply. Unfortunately, I can't get this to work. If my properties window is open and I run this code... If WinActive ("Indicator Properties - test") then $d = ControlCommand ("Indicator Properties - test", "", "Edit1", "CurrentTab", "") MsgBox(0, "test2", $d) EndIf ...then I just get '1' returned every time. If I replace "Edit1" with "" then I just get the same. Any ideas? Thanks Edited February 14, 2006 by mmillar
dickieknee Posted March 24, 2006 Posted March 24, 2006 Hi dabus,Thanks for your reply. Unfortunately, I can't get this to work. If my properties window is open and I run this code...If WinActive ("Indicator Properties - test") then $d = ControlCommand ("Indicator Properties - test", "", "Edit1", "CurrentTab", "") MsgBox(0, "test2", $d)EndIf...then I just get '1' returned every time. If I replace "Edit1" with "" then I just get the same.Any ideas?Thankshi therehere is the code which you are looking for, it will tell you which tab item you are onin this example i need to know which tab i am on so i can write a file to that tabwhere 0=first tab item, 1=second tab item etc...using GUICtrlRead will tell you which tab item is openthen simply use the value to manipulate the tab $d=GUICtrlRead ( $tab ) If $d = 0 Then GuiCtrlSetData($tab0, $contents) ElseIf $d=1 Then GuiCtrlSetData($tab1, $contents) ElseIf $d=2 Then GuiCtrlSetData($tab2, $contents) ElseIf $d=3 Then GuiCtrlSetData($tab3, $contents) EndIfno i can sleep......
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