Healian Posted November 19, 2010 Share Posted November 19, 2010 (edited) its working !!!!!!!!!!!!!!!!!1 thank you very much Melba23 without you help i wasnt made it thank you autoit and love autoit forum ... sorry JOS i was only asking but wasnt know the laws of the forum and did not know what is the meaning of shoutin in text ? Edited November 19, 2010 by Healian Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 19, 2010 Moderators Share Posted November 19, 2010 Healian,Use something like this to get the handle of the combo:$hApp = WinGetHandle("App_Title") $hComboHandle = ControlGetHandle($hApp, "", "[CLASS:Combo_Class;INSTANCE:Combo_Instance]") ; Get the CLASS and INSTANCE values with the Window Info toolAnd then use the _GUICtrlCombo_* commands to do what you will with the combo. Something along these lines should work:; Select the item _GUICtrlComboBox_SetCurSel($hCntl, 5) ; Use the index of the item you want to select ; Tell Windows you have selected something $iCode = BitShift($CBN_SELCHANGE, -16) _SendMessage($hApp, $WM_COMMAND, $iCode, $hCombo)Have fun! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Realm Posted November 19, 2010 Share Posted November 19, 2010 (edited) Healian,First, use the 'AutoIt Window Info Tool' aka 'Au3Info.exe' to find the control you wish to automate.Then use ControlCommand() with command "SelectString", 'string' to automate the control.If you have any further questions feel free to post here again, however make sure you include information on the control that you find with 'AutoIt Window Info Tool', and what code you have so far, or atleast an example of it.Realm Edit: Guess was already answered, took me too long to reply Edited November 19, 2010 by Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
Healian Posted November 19, 2010 Author Share Posted November 19, 2010 thank you for replaying i will try and report you Link to comment Share on other sites More sharing options...
Realm Posted November 19, 2010 Share Posted November 19, 2010 @Melba23 - Does _GUICtrlComboBox_SetCurSel() work on apps outside of your script? I always assumed that would only work on your own scripts. My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
Healian Posted November 19, 2010 Author Share Posted November 19, 2010 i am trying to use control command becouse i did not understand the first way but control command does not work i made like this ControlCommand ("Program title like it in the info","","SelectString", 'the item which i want') but i have not found text for the listbox i choose in the info Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 19, 2010 Moderators Share Posted November 19, 2010 Realm,The GUICtrl* (without a leading underscore) commands only work on AutoIt native controls - those created with the GUICtrlCreate* commands.But the UDF commands (with a leading underscore) should work on any control of the related type - as long as they were created with the the standard Windows API. After all the controls created by the UDF are standard Windows controls - which is why the return values are handles and not ControlIDs.I have often used the various UDF functions to interact with external apps - in fact many of the Help file examples do just that, look at _GUICtrlMenu_GetMenu for instance! M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Realm Posted November 19, 2010 Share Posted November 19, 2010 (edited) Healian,First, in the 'Window Info Tool' and on the bottom is an EditBox with tabs, click the 'Control' Tab, and replace this information:Title is found in the 'Basic Window Info'Leave 'SelectString' as it is.ControlCommand('Title','','ClassnameNN',"SelectString", 'The text of the selection you wish to choose')If you are still having problems, then repost with a paste of the information you find with the 'Window Info Tool'RealmEdit:@Melba - Thanks, I never knew it. *scratching chin* That gives me some ideas Edited November 19, 2010 by Realm My Contributions: Unix Timestamp: Calculate Unix time, or seconds since Epoch, accounting for your local timezone and daylight savings time. RegEdit Jumper: A Small & Simple interface based on Yashied's Reg Jumper Function, for searching Hives in your registry. Link to comment Share on other sites More sharing options...
Healian Posted November 19, 2010 Author Share Posted November 19, 2010 (edited) melba i am trying with your way but i typed instead of "5" in instance like this $insnum = inputbox ("enter number","enter number") _GUICtrlComboBox_SetCurSel($hCntl, $insnum) but it says variable used without being declared and tried to remove $insum and added the instnce and again variable used without being declared $hApp = WinGetHandle("title of the window") $hComboHandle = ControlGetHandle($hApp, "", "[CLASS:ThunderRT6ComboBox;INSTANCE:3]") ; Get the CLASS and INSTANCE values with the Window Info tool ; Select the item _GUICtrlComboBox_SetCurSel($hCntl,28) ; Use the index of the item you want to select Edited November 19, 2010 by Healian Link to comment Share on other sites More sharing options...
Healian Posted November 19, 2010 Author Share Posted November 19, 2010 realm it still does not select what i want Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 19, 2010 Moderators Share Posted November 19, 2010 Healian, What variable is not declared? Please post all the code you are using. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Healian Posted November 19, 2010 Author Share Posted November 19, 2010 (edited) $servernum = IniRead(@ScriptDir & "\config.ini", "server", 4, "") If $servernum = "" Then $servernum = inputbox ("Enter your server number","Enter your server number (A list with server numbers is included") endif IniWrite(@ScriptDir & "\config.ini", "server", 4, $servernum) run ("program") $hApp = WinGetHandle("PROGRAM TITLE") $hComboHandle = ControlGetHandle($hApp, "", "[CLASS:ThunderRT6ComboBox;INSTANCE:3]") ; Get the CLASS and INSTANCE values with the Window Info tool ; Select the item _GUICtrlComboBox_SetCurSel($hCntl,28) ; Use the index of the item you want to select ; Tell Windows you have selected something $iCode = BitShift($CBN_SELCHANGE, -16) _SendMessage($hApp, $WM_COMMAND, $iCode, $hCombo) AND IT SAYS VARIABLE USED WITHOUT BEING DECLARED Edited November 19, 2010 by Healian Link to comment Share on other sites More sharing options...
kaotkbliss Posted November 19, 2010 Share Posted November 19, 2010 (edited) I can see this vaiable was never defined (at least in what you posted) _GUICtrlComboBox_SetCurSel($hCntl <--- *edit* and if it were me, I would put the iniwrite before the endif so it only writes to the ini if there wasn't a previous value. As it stands, it reads the value, then writes it back in. Edited November 19, 2010 by kaotkbliss 010101000110100001101001011100110010000001101001011100110010000 001101101011110010010000001110011011010010110011100100001 My Android cat and mouse gamehttps://play.google.com/store/apps/details?id=com.KaosVisions.WhiskersNSqueek We're gonna need another Timmy! Link to comment Share on other sites More sharing options...
Healian Posted November 19, 2010 Author Share Posted November 19, 2010 $servernum = IniRead(@ScriptDir & "\config.ini", "server", 4, "") If $servernum = "" Then $servernum = inputbox ("Enter your server number","Enter your server number (A list with server numbers is included") endif IniWrite(@ScriptDir & "\config.ini", "server", 4, $servernum) run ("program") $hApp = WinGetHandle("PROGRAM TITLE") $hComboHandle = ControlGetHandle($hApp, "", "[CLASS:ThunderRT6ComboBox;INSTANCE:3]") ; Get the CLASS and INSTANCE values with the Window Info tool ; Select the item _GUICtrlComboBox_SetCurSel($hCntl,28) ; Use the index of the item you want to select ; Tell Windows you have selected something $iCode = BitShift($CBN_SELCHANGE, -16) _SendMessage($hApp, $WM_COMMAND, $iCode, $hCombo) AND IT SAYS VARIABLE USED WITHOUT BEING DECLARED Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 19, 2010 Moderators Share Posted November 19, 2010 Healian, AND IT SAYS VARIABLE USED WITHOUT BEING DECLAREDDo you remember what Jos said here? Please stop shouting. There are a whole bunch of things which are not declared in that script. I should have been clearer in my earlier post but I gave you credit for knowing a little about AutoIt - it seems I was mistaken. So let us take them one by one: $hCntl and $hCombo - You need to use $hComboHandle here. _GUICtrlComboBox_SetCurSel and $CBN_SELCHANGE - Put #Include <GuiComboBox.au3> at the top of your script - you need that to run the function and it will give you the message value as well. $WM_COMMAND - Put #Include <WindowsConstants.au3> at the top of your script - that include file will give you this variable. _SendMessage() - Put #Include <SendMessage.au3> at the top of your script - that include file will give you this function. So your code should read: #Include <WindowsConstants.au3> #Include <GuiComboBox.au3> #Include <SendMessage.au3> $servernum = IniRead(@ScriptDir & "\config.ini", "server", 4, "") If $servernum = "" Then $servernum = InputBox("Enter your server number", "Enter your server number (A list with server numbers is included") EndIf IniWrite(@ScriptDir & "\config.ini", "server", 4, $servernum) Run("program") $hApp = WinGetHandle("PROGRAM TITLE") $hComboHandle = ControlGetHandle($hApp, "", "[CLASS:ThunderRT6ComboBox;INSTANCE:3]") ; Get the CLASS and INSTANCE values with the Window Info tool ; Select the item _GUICtrlComboBox_SetCurSel($hComboHandle, 28) ; Use the index of the item you want to select ; Tell Windows you have selected something $iCode = BitShift($CBN_SELCHANGE, -16) _SendMessage($hApp, $WM_COMMAND, $iCode, $hComboHandle) When I syntax check that, I get no errors. Now I would very strongly suggest that before you do any more coding, you learn a bit more about how Autoit is structured - things like #include files, for example. Reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at the excellent tutorials that you will find here and here - you will find other tutorials in the Wiki (the link is at the top of the page). There are even video tutorials on YouTube if you prefer watching to reading. I know you want to start coding NOW, but a little study will save you (and us ) a lot of trouble later on, believe me. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Healian Posted November 19, 2010 Author Share Posted November 19, 2010 what do you mean by shouting i am not understand Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 19, 2010 Moderators Share Posted November 19, 2010 Healian, THIS IS SHOUTING and it is considered rude, which is why Jos asked you not to do it. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
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