Indigo Rose Software
  #1  
Old 01-18-2007
Worm Worm is offline
Indigo Rose Customer
 
Join Date: Jul 2002
Location: USA
Posts: 3,937
Example: Using Send Message to Populate Listbox

I've seen some posts here where it has been stated the Listbox gets slow when there are a lot of items. Here is a way to populate the Listbox using a function I wrote that uses SendMessage (User32.dll function) to add the items to the Listbox.

I tried populating a Listbox with ListBox.AddItem with 5000 items. I killed the task after 4 minutes. Using this function, it took 6 seconds to add the 5000 items

Enjoy!

Last edited by Worm; 01-18-2007 at 02:07 PM.
Reply With Quote
  #2  
Old 01-18-2007
Desmond's Avatar
Desmond Desmond is offline
Indigo Rose Staff Member
 
Join Date: Jul 2003
Posts: 628
It is also possible to add a wack of items quickly by first stopping the listbox from updating it's view until you're finished:

Code:
-- Stop listbox from updating
ListBox.SetUpdate("ListBox1", false);

-- Add 5000 items
min = 1;  -- The number to start at
max = 5000;  -- The number to stop at 
for count=1, 5000 do
	ListBox.AddItem("ListBox1", count, "");
end

-- Let the listbox update
ListBox.SetUpdate("ListBox1", true);
__________________
Setup Factory 8.0 comes with over 250 actions so you can create smaller, faster and more intelligent software installers than ever before.

WebHelp Guides: AMS | MSIFACT | SUF | TU | VP
Reply With Quote
  #3  
Old 01-18-2007
Worm Worm is offline
Indigo Rose Customer
 
Join Date: Jul 2002
Location: USA
Posts: 3,937
That's faster yet!

Plus I just realized the function I posted doesn't work properly!
It adds the item to the listbox, but you can't select them.... yikes!
Reply With Quote
  #4  
Old 01-18-2007
rhosk's Avatar
rhosk rhosk is offline
Indigo Rose Customer
 
Join Date: Aug 2003
Location: Maine, USA
Posts: 1,692
Uh, Worm, let's QA these things a little better, eh?

...kidding...
__________________
Regards,

-Ron

Music | Video | Pictures
Reply With Quote
  #5  
Old 01-18-2007
Worm Worm is offline
Indigo Rose Customer
 
Join Date: Jul 2002
Location: USA
Posts: 3,937
Heee!

That's a definite. Although its very odd that the item shows in the listbox, yet won't select. Ya gotta give me that, right?

I'm grabbin' here man, help a brother out, eh.
Reply With Quote
  #6  
Old 01-19-2007
Desmond's Avatar
Desmond Desmond is offline
Indigo Rose Staff Member
 
Join Date: Jul 2003
Posts: 628
'Tis odd ... But my way is still better! mua ha ha ha ha ha ha ha!!!
__________________
Setup Factory 8.0 comes with over 250 actions so you can create smaller, faster and more intelligent software installers than ever before.

WebHelp Guides: AMS | MSIFACT | SUF | TU | VP
Reply With Quote
  #7  
Old 01-19-2007
Worm Worm is offline
Indigo Rose Customer
 
Join Date: Jul 2002
Location: USA
Posts: 3,937
yup it is.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Populate Listbox from External File rbourbonnais AutoPlay Media Studio 5.0 7 03-20-2006 06:59 AM
Send OK message rhosk AutoPlay Media Studio 5.0 12 11-23-2005 01:17 AM
Send message to another computer Rene AutoPlay Media Studio 5.0 0 06-02-2005 05:37 PM
INI file to populate a listbox pjhiggins AutoPlay Media Studio 5.0 17 05-04-2004 05:08 PM
Packages and If Statements Medlir Setup Factory 6.0 4 05-09-2002 04:51 PM


All times are GMT -6. The time now is 03:38 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright © 2000 - 2009 Indigo Rose Corporation. All rights reserved.
Indigo Rose Software