vimala Posted September 9, 2009 Share Posted September 9, 2009 hello sir/madam I have tried with _guictrlcomboboxEx _* and _guictrlcombobox_* and these are not working with combobox. further each time control handle keeps changing.which handle to be given in commands ie window or control handle? I have even tried with control commands "select string" and this is not working.can u suggest some more commands to send values to combobox . thanks a lot for your reply Link to comment Share on other sites More sharing options...
water Posted September 9, 2009 Share Posted September 9, 2009 Some questions that come to my mind:Do you create the combobox yourself or is it the combobox of another program?What do you want to do with the combobox? Do you want to add new values to the combox?Could you show the code you have so far? My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
vimala Posted September 9, 2009 Author Share Posted September 9, 2009 Some questions that come to my mind: Do you create the combobox yourself or is it the combobox of another program?What do you want to do with the combobox? Do you want to add new values to the combox?Could you show the code you have so far?it is the combobox of .net application. i need to automate by reading excel sheet values the code here is MouseMove(527,523) MouseDown("left") MouseUp("left") $value12=$val12[$j] $val12=_ExcelReadarray($oExcel,6,12,7,1,0) _GUICtrlComboBox_SetCurSel(0x00010014,10) Link to comment Share on other sites More sharing options...
water Posted September 9, 2009 Share Posted September 9, 2009 (edited) You could use AutoIt's Window Info Tool "Au3Info.exe" to get the ControlId of the Combobox and then ControlGetHandle to get the handle of the combobox. Then you can use the _GUICtrlComboBox_* commands on that handle. Edited September 9, 2009 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
PsaltyDS Posted September 9, 2009 Share Posted September 9, 2009 _GUICtrlComboBox_SetCurSel(0x00010014,10) You should get the handle with ControlGetHandle(), as water posted. But if you should want to declare a literal handle (which will only work in the current instance of the GUI as handles change every time) use Hwnd(): $hCombo = Hwnd(0x00010014) _GuiCtrlComboBox_SetCurSel($hCombo, 10) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
vimala Posted September 10, 2009 Author Share Posted September 10, 2009 hello sir I have used all commands ie _guictrlcommands to send values to a combobox and also tried with handle .do we need to use opt() function? combobox has 5 values starting with letter B(bangladesh,barbados,bahrain,...) how to edit a combobox? Link to comment Share on other sites More sharing options...
water Posted September 10, 2009 Share Posted September 10, 2009 Could you please post the code you have so far? That's the best way we can help you. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
vimala Posted September 10, 2009 Author Share Posted September 10, 2009 Could you please post the code you have so far? That's the best way we can help you.iam getting error like "ERROR OCCURED WHILE WRITING TO EVENT LOG"WOULD U HELP ME IN SOLVING THIS?WILL BE A PROBLEM WITH COMBOBOX PROPERTY?THANKS Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 10, 2009 Moderators Share Posted September 10, 2009 .NET is a pain to automate. The best thing you can do is get the control information by it's client coordinates position on the applications GUI.Once you get the controls position, _CtrlGetByPos or look at the _WinAPI_WindowFromPoint(), then you can start to manipulate with some _GUICtrlCombo* functions.One thing I'll say is, in my experience, you do quite a bit of ControlSend/ControlClick/Control* functions rather than using the UDF functions, because there's always an underlying control to the control you're trying to manipulate it seems.In addition, please refrain from typing in Caps, it's considered offensive to some, and it makes it hard to read for others. Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
hoanglz Posted September 11, 2009 Share Posted September 11, 2009 hi there,I try to get the data from a .NET listbox control, but ControlCommand(..."GetSelected", "") seem does not work, I got nothing.I try to get the number o Item in the listbox.@SmOke_N: we can not get information of .NET Listbox control? so sad.... Link to comment Share on other sites More sharing options...
hoanglz Posted September 11, 2009 Share Posted September 11, 2009 oh, I found a topic has the same issue with me and he solve the problem already. I should try to read help file first. http://www.autoitscript.com/forum/index.php?showtopic=102128 Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 11, 2009 Moderators Share Posted September 11, 2009 hi there,I try to get the data from a .NET listbox control, but ControlCommand(..."GetSelected", "") seem does not work, I got nothing.I try to get the number o Item in the listbox.@SmOke_N: we can not get information of .NET Listbox control? so sad....WHOAH!!!I never said you couldn't get the info of a .NET listbox ( in fact, that's simple! ).You were talking ComboBox... whole different thing!Glad you found a solution, but what I posted works too! Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
vimala Posted September 15, 2009 Author Share Posted September 15, 2009 You could use AutoIt's Window Info Tool "Au3Info.exe" to get the ControlId of the Combobox and then ControlGetHandle to get the handle of the combobox.Then you can use the _GUICtrlComboBox_* commands on that handle. Link to comment Share on other sites More sharing options...
vimala Posted September 15, 2009 Author Share Posted September 15, 2009 Could you please post the code you have so far? That's the best way we can help you.I thank you for your helpvimala Link to comment Share on other sites More sharing options...
vimala Posted September 15, 2009 Author Share Posted September 15, 2009 Could you please post the code you have so far? That's the best way we can help you.I thank you for your help i found out solutionvimala Link to comment Share on other sites More sharing options...
vimala Posted September 15, 2009 Author Share Posted September 15, 2009 .NET is a pain to automate. The best thing you can do is get the control information by it's client coordinates position on the applications GUI.Once you get the controls position, _CtrlGetByPos or look at the _WinAPI_WindowFromPoint(), then you can start to manipulate with some _GUICtrlCombo* functions.One thing I'll say is, in my experience, you do quite a bit of ControlSend/ControlClick/Control* functions rather than using the UDF functions, because there's always an underlying control to the control you're trying to manipulate it seems.In addition, please refrain from typing in Caps, it's considered offensive to some, and it makes it hard to read for others. hello I found out solution for combobox control.i followed as water replied.iused control get handle fn and _guictrlcombobox.thank youi feel sorry for using caps. Link to comment Share on other sites More sharing options...
vimala Posted September 15, 2009 Author Share Posted September 15, 2009 Could you please post the code you have so far? That's the best way we can help you.i found out solution.i followed as u told by using control handle and guictrlcommandsthank youvimala 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