Zohar Posted January 25, 2009 Share Posted January 25, 2009 (edited) Hello Can I perform operations on IE's AutoComplete ListBox? for example _GUICtrlListBox_SelectString. Right now what I'm doing is Sending "{Down}" several times, to select the right Item in the AutoComplete ListBox. But the items there may change in the future, so I'm looking for a more deterministic way of selecting a specific item, via its string.. Is it possible? How do I get a Handle to the AutoComplete ListBox? Edited March 4, 2009 by Zohar Link to comment Share on other sites More sharing options...
Pain Posted January 25, 2009 Share Posted January 25, 2009 Are you sure it's a listbox and not a dropdown? If it's a listbox you can use _GUICtrlListBox_SelectString as you said. The only difference from when you use it on your own GUI is that you need to get the handle (WinGetHandle) and use it as the $hWnd parameter. Link to comment Share on other sites More sharing options...
Zohar Posted January 25, 2009 Author Share Posted January 25, 2009 It looks like a TextBox+ListBox no? doesn't really look like a ComboBox.. you can see it in any site where you are required to enter Username+Password, and AutoComplete rememebers the usernames that used this site already. my problem is to get the Handle to it.. anyone has done this before and can paste the code he used? Link to comment Share on other sites More sharing options...
Pain Posted January 25, 2009 Share Posted January 25, 2009 I was thinking it might be a combobox because _GUICtrlComboBox_AutoComplete creates a AutoComplete box. Link to comment Share on other sites More sharing options...
Zohar Posted January 26, 2009 Author Share Posted January 26, 2009 (edited) Well,using AutoIt Window Info tool, I discovered that apparently the AutoComplete control is actually a ListView.It seems like a ListView that has its own small window(this small window's size, and the listview' size are the same).I attached here a screen shot of AutoIt Window Info tool, when pointing an open AutoComplete box.The CLASSNN for the control is SysListView321.But the weird thing is that the CLASS of the window containing it, is a name that contains spaces.. "Auto-Suggest Dropdown"...How can a class name contain spaces hehe..[see the attached image]anyhow, I tried getting a Handle to this ListView control, and then Finding an item there,and the result I get is 0 instead of 3.anyone knows what I am doing wrong and how to fix it?CODELocal $hAutoComplete =ControlGetHandle("[CLASS:Auto-Suggest Dropdown]","","[CLASSNN:SysListView321]")MsgBox(0,"",_GUICtrlListView_FindText($hAutoComplete,"user3")) Edited January 27, 2009 by Zohar Link to comment Share on other sites More sharing options...
Zohar Posted March 4, 2009 Author Share Posted March 4, 2009 the solution: Func FindItemInFormAutoComplete($Item_Text) Local $hControl =ControlGetHandle("AutoSuggest Drop-Down","","[CLASSNN:SysListView321]") Return _GUICtrlListView_FindInText($hControl,$Item_Text) EndFunc 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