riddertje Posted September 20, 2007 Posted September 20, 2007 ControlListView("Add", "List1", 1002, "SelectAll");I'm trying to select all the items in a listview of the utility PowerPost. Below is a screenshot of the app with auto it window info tool on top of it. Could anyone help me understand why the above line won't select all the available options?
Zedna Posted September 20, 2007 Posted September 20, 2007 (edited) tryControlListView("Add", "", 1002, "SelectAll")orControlListView("Add", "", "SysListView321", "SelectAll")EDIT: if you want to check on checkboxes then look at Auto3Library from PaulIA where are enhanced ListView control capabilities Edited September 20, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
PsaltyDS Posted September 20, 2007 Posted September 20, 2007 ControlListView("Add", "List1", 1002, "SelectAll"); I'm trying to select all the items in a listview of the utility PowerPost. Below is a screenshot of the app with auto it window info tool on top of it. Could anyone help me understand why the above line won't select all the available options? Because a SysListView32 is not the same thing as a ListView. There are some similarities, but many differences. If you get PaulIA's Auto3Lib UDF, which includes the A3LListView.au3 UDF, you might get some things to work, but it won't be fully functional. Same with the _GuiCtrlListView* included functions in the recent versions of AutoIt. I don't know enough about it to say for sure, but evidently Microsoft has chosen not to document the interface for that type of control for some reason. There was a SysListView UDF a long time ago, but I don't think it is currently maintained (try the search). In short... SysListView is a bad spot in scripted automation right now. 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
Zedna Posted September 20, 2007 Posted September 20, 2007 (edited) Because a SysListView32 is not the same thing as a ListView. There are some similarities, but many differences.I don't know what are you talking about.I use ControlListview() and also Auto3Library successfully on SysListView32 controls all the time. Edited September 20, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
PsaltyDS Posted September 20, 2007 Posted September 20, 2007 I don't know what are you talking about.I use ControlListview() and also Auto3Library successfully on SysListView32 controls all the time.I've had some success, and other places where it didn't work at all. Some of the SharePoint Backup/Restore utility windows were part of it, I believe (don't have them in front of me to play with right now). I was relaying problems I had run into some time ago: SysListView32 controls that refused to give the same results as ListViews. It's easy to believe you know more about it than I do, though, and maybe I should go back and take another shot at those scripts... 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
GaryFrost Posted September 20, 2007 Posted September 20, 2007 PsaltyDS run an an autoitscript that has a listview in it, and run the au3info on it, you'll see it is a SysListView32 control SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference.
PsaltyDS Posted September 20, 2007 Posted September 20, 2007 PsaltyDS run an an autoitscript that has a listview in it, and run the au3info on it, you'll see it is a SysListView32 controlWell, it wouldn't be the first time I was just plain wrong, and surely won't be the last. I'll have to go back and review what I was doing about 18 months to two years ago that gave me such fits with SysListView32... 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
riddertje Posted September 20, 2007 Author Posted September 20, 2007 Thank you guys, but could anyone give me an example how exactly this Auto3Lib thing would be in code? I downloaded and installed it and read the help file on the ListView module, but I can't quite figure it out. Can I include those extension files directly? It looks to me like all the functions are based on an own created GUI, since it referres to an 'handler' which I can't seem to find in the autoit window info program. What should I use for that? _ListView_SetItemChecked($hWnd, $iIndex[, $fCheck, $fMove]) Parameters $hWnd Handle to the control $iIndex Zero based index of the item $fCheck [Optional] Item check state: True - Check item False - Uncheck item Default value is True. $fMove [Optional] If True, the mouse will be moved. If False, the mouse does not move. Default value is False.
Zedna Posted September 20, 2007 Posted September 20, 2007 Thank you guys, but could anyone give me an example how exactly this Auto3Lib thing would be in code? I downloaded and installed it and read the help file on the ListView module, but I can't quite figure it out. Can I include those extension files directly?It looks to me like all the functions are based on an own created GUI, since it referres to an 'handler' which I can't seem to find in the autoit window info program. What should I use for that?Look at examples:"c:\Program Files\AutoIt3\Auto3Lib\ListView 1.au3" "c:\Program Files\AutoIt3\Auto3Lib\ListView 2.au3" Auto3Lib is primary intented to control external applications. Resources UDF ResourcesEx UDF AutoIt Forum Search
Zedna Posted September 20, 2007 Posted September 20, 2007 (edited) I've had some success, and other places where it didn't work at all. Some of the SharePoint Backup/Restore utility windows were part of it, I believe (don't have them in front of me to play with right now). I was relaying problems I had run into some time ago: SysListView32 controls that refused to give the same results as ListViews. It's easy to believe you know more about it than I do, though, and maybe I should go back and take another shot at those scripts... PsaltyDS stay cool. I'm not god I just stated that I haven't this kind of problems like you said with these standard ListView controls.No offense Edited September 20, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
riddertje Posted September 20, 2007 Author Posted September 20, 2007 (edited) Look at examples:"c:\Program Files\AutoIt3\Auto3Lib\ListView 1.au3" "c:\Program Files\AutoIt3\Auto3Lib\ListView 2.au3" Auto3Lib is primary intented to control external applications.I can't get a hold of those examples... Bare in mind that I am just a newbie to AutoIT. I've used it a couple of times a while ago for some very basic clicking and stuff and I do PHP quite well, that's why I got this far already without significant knowledge about AutoIT, but this one really beats me.All I want to do is check all those checkboxes in the listview of the given application. Now the AutoIT help file states the ControlListView() function, I tried different combinations of IDs, classes, names and texts to let AutoIT know where I'm talking about and I chose a command ("SelectAll") that was listed in the help file, but neither of them seems to work.Then A3Lib. Using extensions to get such an easy and basic job done looks to me like a bit overkill. But well, all I want is to get it working. So hello A3Lib. But I don't have time to crawl through yet another (well documented) help file to find that one function to use to check all options in a listview.Could anyone point it out to me? Which functions to use, that's all.. I'll figure it out with the help file how to use it and all... Edited September 20, 2007 by riddertje
Zedna Posted September 20, 2007 Posted September 20, 2007 (edited) Without Auto3Library would be live very sad ;-) #include <A3LListView.au3> $hList = ControlGetHandle("Add", "", "SysListView321") ; to check only first two items ;~ _ListView_SetItemChecked($hList, 0, True) ;~ _ListView_SetItemChecked($hList, 1, True) ; to check all items For $i = 0 To _ListView_GetItemCount($hList) - 1 _ListView_SetItemChecked($hList, $i, True) Next Edited September 20, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
riddertje Posted September 20, 2007 Author Posted September 20, 2007 Without Auto3Library would be live very sad ;-) #include <A3LListView.au3> $hList = ControlGetHandle("Add", "", "SysListView321") ; to check only first two items ;~ _ListView_SetItemChecked($hList, 0, True) ;~ _ListView_SetItemChecked($hList, 1, True) ; to check all items For $i = 0 To _ListView_GetItemCount($hList) - 1 _ListView_SetItemChecked($hList, $i, True) NextIt's a shame I can't get over and kiss you right now, if it were only for social and cultural reasons You're my hero for all Friday . That script just works like a charm!
Zedna Posted September 20, 2007 Posted September 20, 2007 It's a shame I can't get over and kiss you right now, if it were only for social and cultural reasons You're my hero for all Friday . That script just works like a charm!I'm proud to be your hero for today Resources UDF ResourcesEx UDF AutoIt Forum Search
Roland999 Posted February 8, 2012 Posted February 8, 2012 (edited) Without Auto3Library would be live very sad ;-) #include <A3LListView.au3> $hList = ControlGetHandle("Add", "", "SysListView321") ;~ _ListView_SetItemChecked($hList, 0, True); to check 1st item For $i = 0 To _ListView_GetItemCount($hList) - 1 ; to check all items ... As Auto3Library seems to be integrated in AutoIT3, how should the above be coded today? Should I call ControlListView($hList, "GetItemCount") ??? (incorrect nr of args) Somehow I cannot find documentation on how to use control handles. I need this functionality to manage a SysListView32 control. Edited February 8, 2012 by Roland999
undream Posted March 12, 2012 Posted March 12, 2012 I have almost exactly the same problem (have my topic active) but can't find a solution...
Zedna Posted April 1, 2012 Posted April 1, 2012 You can use ControlListView() for simple tasks or you can use standard UDF GUIListView functions for more complicated tasks. Look into Autoit's helpfile at User Defined Functions Reference/GUIListView Management/ _GUICtrlListView_GetItemCount() _GUICtrlListView_SetItemChecked() There are nice examples. Resources UDF ResourcesEx UDF AutoIt Forum Search
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