BigDaddyO Posted December 8, 2004 Share Posted December 8, 2004 I am attempting to retrieve all the information from a ComboBox with no luck using the current stable version of AutoIT. see my previous PostI was lurking around and found a dllcall function that is only available in the beta version. There was a Post explaining some use with a link to combobox items. here is the code that was given.$hwnd = ControlGethandle("...","...","...") ;ControlGethandle("title", "text", "classnameNN") Global $CB_GETCURSEL = 0x0147 $i = dllcall("user32.dll","int","SendMessage","hWnd",$hwnd,"int",$CB_GETCURSEL,"int", 0,"int", 0) MsgBox(0,"","Item selected : " & $i[0]) ControlCommand ("..","...", "...","SetCurrentSelection",$i[0])I am hoping that I can use CB_GETCOMBOBOXINFO to save all of the items in a combo box to a file. But before I download, install, and attempt to learn the Beta version I was wondering if someone could tell me if this will work.Thanks, Link to comment Share on other sites More sharing options...
BigDaddyO Posted December 8, 2004 Author Share Posted December 8, 2004 Well, SendMessage + CB_GETCOMBOBOXINFO requires a structure, that is NOT supported. But... (BIG BUT), even if you could call it, CB_GETCOMBOBOXINFO would not give you a list of the combobox's contents... is that what you want? a list of the contents?Lar.edit: you would need to loop through $CB_GETCURSEL starting at 0 until it fails...Lar.<{POST_SNAPBACK}>Yes I want to get a list of the combo boxes contents. will the $CB_GetCursel retrieve all the information without selecting any items from the combobox? If any item is selected it can take up to 3 Minutes to load the item before I can continue on. Link to comment Share on other sites More sharing options...
BigDaddyO Posted December 8, 2004 Author Share Posted December 8, 2004 Thanks for the info Larry, I will download the unstable version and try that out. Mike Link to comment Share on other sites More sharing options...
BigDaddyO Posted December 8, 2004 Author Share Posted December 8, 2004 Larry, You are always such a big help. You should change your avatar to a depiction of GOD holding an AutoIT symbol. Mike Link to comment Share on other sites More sharing options...
tuape Posted December 15, 2004 Share Posted December 15, 2004 I am sorry... it is CB_GETLBTEXT like...here... test this on the combobox of the "Run" dialog...$hwnd = ControlGethandle("Run","","ComboBox1") ;ControlGethandle("title", "text", "classnameNN") Global $CB_GETLBTEXT = 0x0148 $i = 0 $list = "" While 1 $x = dllcall("user32.dll","int","SendMessage",_ "hWnd",$hwnd,_ "int",$CB_GETLBTEXT,_ "int", $i,"str", "") If Not @error And $x[0] >= 0 Then $list = $list & $x[4] & @LF Else ExitLoop EndIf $i = $i + 1 WEnd MsgBox(4096,"",$list)<{POST_SNAPBACK}>Very nice.I noticed one problem though: try this with Windows explorer. At least I got just the first letter of every item on the list. With Run dialog it works correctly.Can anybody explain why? Link to comment Share on other sites More sharing options...
kanumi Posted December 16, 2004 Share Posted December 16, 2004 I noticed one problem though: try this with Windows explorer. At least I got just the first letter of every item on the list. With Run dialog it works correctly.Can anybody explain why?<{POST_SNAPBACK}>First thought : May be You got an unicode string from IE. Link to comment Share on other sites More sharing options...
BigDaddyO Posted December 16, 2004 Author Share Posted December 16, 2004 This was intended for Combo Boxes. What control in Windows Explorer are you running this on? Link to comment Share on other sites More sharing options...
tuape Posted December 16, 2004 Share Posted December 16, 2004 This was intended for Combo Boxes. What control in Windows Explorer are you running this on?<{POST_SNAPBACK}>ComboBox1 That is the 'Address' combobox Link to comment Share on other sites More sharing options...
tuape Posted December 20, 2004 Share Posted December 20, 2004 ComboBox1 That is the 'Address' combobox<{POST_SNAPBACK}>Is there anyone who can explain why comboboxes act differently? 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