Iznogoud 0 Posted June 3, 2006 (edited) I am trying to automatic install a Terminal Server in a Windows 2003 Enviroment. To do this i need the first part to install some components in Add & Remove programs. But you cant read the values from a listbox. I have found a script wich does it in the same way BUT. #include <GUIConstants.au3> GUICreate("My GUICtrlRead"); will create a dialog box that when displayed is centered $n1=GUICtrlCreateList ("", 10,10,-1,100 ) GUICtrlSetData(-1,"item1|item2|item3", "item2") $n2=GUICtrlCreateButton ("button",0,100) GUICtrlSetState(-1,$GUI_FOCUS) ; the focus is on this button GUISetState () ; will display an empty dialog box ; Run the GUI until the dialog is closed Do $msg = GUIGetMsg() if $msg = $n2 then msgbox(0,"list=", GUICtrlRead($n1)); display the value endif Until $msg = $GUI_EVENT_CLOSE But how do i adjust this script to read the values from a other gui. When you click the button in reads the value from $n1, $n1=GUICtrlCreateList ("", 10,10,-1,100 ). How can $n1 become the value of Add & Remove programs GUI. Can you guys kick me in the good direction Edited June 3, 2006 by Iznogoud Share this post Link to post Share on other sites
exodius 1 Posted June 4, 2006 I'm not exactly sure what you mean by "But you cant read the values from a listbox." Are you trying to read what programs are installed from the Add/Remove Programs window?If you are, I'd look at http://support.microsoft.com/kb/314481 for how you can get a listing through the registry.If you aren't, could you try to explain it again? Share this post Link to post Share on other sites
Iznogoud 0 Posted June 4, 2006 (edited) I'm not exactly sure what you mean by "But you cant read the values from a listbox." Are you trying to read what programs are installed from the Add/Remove Programs window?If you are, I'd look at http://support.microsoft.com/kb/314481 for how you can get a listing through the registry.If you aren't, could you try to explain it again?Ok i have made a screenshot:-images deleted-What i wanna try to accomplish is, that i can read out the description so if the discription is Includes Windows Acc.... the spacebar is pressed, for an example.I have found the script wich i posted above wich does the trick in his own GUI wich is created by the script. But how can i do this on this Windows Components Wizard window?If i can read out the discription i can enable some options wich i need to install terminal server.Hope its clear now Edited June 4, 2006 by Iznogoud Share this post Link to post Share on other sites
exodius 1 Posted June 4, 2006 (edited) What i wanna try to accomplish is, that i can read out the description so if the discription is Includes Windows Acc.... the spacebar is pressed, for an example. I have found the script wich i posted above wich does the trick in his own GUI wich is created by the script. But how can i do this on this Windows Components Wizard window? If i can read out the discription i can enable some options wich i need to install terminal server. Hope its clear now I think this is something along the lines of what you're looking for, let me know if it's not... First open that Windows Components window, then run this. WinWait ( "Windows Components" ) WinActivate ( "Windows Components" ) WinWaitActive ( "Windows Components" ) ControlCommand ( "Windows Components", "", "ListBox1", "SelectString", 'Accessories and Utilities' ) WinWait ( "Accessories and Utilities" ) WinActivate ( "Accessories and Utilities" ) WinWaitActive ( "Accessories and Utilities" ) ControlCommand ( "Accessories and Utilities", "", "ListBox1", "SelectString", 'Games' ) WinWait ( "Games" ) WinActivate ( "Games" ) WinWaitActive ( "Games" ) ControlCommand ( "Games", "", "ListBox1", "SelectString", 'Minesweeper' ) ControlSend ( "Games", "", "ListBox1", "{Space}") Edited June 4, 2006 by exodius Share this post Link to post Share on other sites
Iznogoud 0 Posted June 4, 2006 I think this is something along the lines of what you're looking for, let me know if it's not... First open that Windows Components window, then run this. WinWait ( "Windows Components" ) WinActivate ( "Windows Components" ) WinWaitActive ( "Windows Components" ) ControlCommand ( "Windows Components", "", "ListBox1", "SelectString", 'Accessories and Utilities' ) WinWait ( "Accessories and Utilities" ) WinActivate ( "Accessories and Utilities" ) WinWaitActive ( "Accessories and Utilities" ) ControlCommand ( "Accessories and Utilities", "", "ListBox1", "SelectString", 'Games' ) WinWait ( "Games" ) WinActivate ( "Games" ) WinWaitActive ( "Games" ) ControlCommand ( "Games", "", "ListBox1", "SelectString", 'Minesweeper' ) ControlSend ( "Games", "", "ListBox1", "{Space}") Yep the ControlCommand function does the job. A screenshot speaks for 1000 words Thx this makes alot of things much easier. Share this post Link to post Share on other sites
exodius 1 Posted June 4, 2006 Yep the ControlCommand function does the job. A screenshot speaks for 1000 words Thx this makes alot of things much easier.It sure got me on track with what you were talking about in particular... I didn't even think about the Windows Components list when you started talking about Add/Remove Programs. Share this post Link to post Share on other sites