MrSergey Posted August 4, 2009 Share Posted August 4, 2009 Hi, Sorry for my english... It's my code: #include <GUIConstants.au3> #Include <GuiListView.au3> $GUI = GUICreate("Listview", 300,300) $hListView = GuiCtrlCreateListView("1|2|3|4|5|6|7", 10, 10, 280, 290,-1, BitOR($LVS_EX_GRIDLINES,$LVS_EX_FULLROWSELECT )) $x = 100 For $i = 0 to $x GUICtrlCreateListViewItem("1|2|3|4|5|6|7", $hListView) Next GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit EndIf Sleep(10) WEnd If $x small then all work fast, but if $x > 1000 then the window is created too long. In my program I need use $x = 50000. Time of window creation = 1 min. It's VERY long. How I can accelerate process of window creation? Link to comment Share on other sites More sharing options...
water Posted August 4, 2009 Share Posted August 4, 2009 (edited) You could use the GuiListView UDF. Function _GUICtrlListView_AddArray adds items from an array to the control See User Defined Functions -> GuiListView Management in the help file. Edited August 4, 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...
picaxe Posted August 4, 2009 Share Posted August 4, 2009 (edited) I've used version of this for listviews with > 100,000 rows. Note it may be missing includes for the current version of AutoIt. Edited August 4, 2009 by picaxe Link to comment Share on other sites More sharing options...
MrSergey Posted August 4, 2009 Author Share Posted August 4, 2009 I've used version of this for listviews with > 100,000 rowsThanks!!! It's realy fast!!!But how I can use the given code for my creation ListView?Code very long and difficult. Probably exists UDF on ListView with use of the given code? Link to comment Share on other sites More sharing options...
SandelPerieanu Posted August 5, 2009 Share Posted August 5, 2009 (edited) #include <GUIConstants.au3> #Include <GuiListView.au3> $GUI = GUICreate("Listview", 300,300) $hListView = GuiCtrlCreateListView("1|2|3|4|5|6|7", 10, 10, 280, 290,-1, BitOR($LVS_EX_GRIDLINES,$LVS_EX_FULLROWSELECT )) $x = 100000 _GUICtrlListView_BeginUpdate($hListView) For $i = 0 to $x GUICtrlCreateListViewItem("1|2|3|4|5|6|7", $hListView) Next _GUICtrlListView_EndUpdate($hListView) GUISetState() While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then Exit EndIf Sleep(10) WEnd added : 1. _GUICtrlListView_BeginUpdate($hListView) 2. _GUICtrlListView_EndUpdate($hListView) Edited August 5, 2009 by psandu.ro Link to comment Share on other sites More sharing options...
Zedna Posted August 10, 2009 Share Posted August 10, 2009 Also look at my post about ListView UDF speed optimization http://www.autoitscript.com/forum/index.php?showtopic=67829 Resources UDF ResourcesEx UDF AutoIt Forum Search Link to comment Share on other sites More sharing options...
MrSergey Posted August 11, 2009 Author Share Posted August 11, 2009 Now I randomly noticed there is _GUICtrlListView_AddArray() function which is based on the same optimization idea!! >_< 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