quote:
Originally posted by SpunkyLoveMuff
quote:
Originally posted by CookieRevised
Why don't you create the window and fill in the listview when it is actually needed for the first time? In that way you don't slow other things down...
Unless you constantly need to add to the listview also... but then again, you also could simply store everything in an array and only create the listview (from that array) when it actually needs to be shown to the user. This will be way faster...not only in loading but in general executing too (as updating a listview takes a lot of processing).
Basically whats happening is, the array is loaded in the list box and then, when a certain function is called, a loop searches to see if a variable is equal to the current value in the 1st column... if it is, the variable is replaced by the current value in the second column and passed back...
it's basically replacing email addresses with a user defined nickname so that my script can show who the user is talking to, without giving away they're email address...
As the function that performs this is called quite frequently, it's not a very good idea to read from the registry at that point. So it's easier to read the registry at startup and then it updates as it goes along...
It is even a worse idea to use a listview for that. Reading from the registry would actually be faster than updating a listview....
A way faster method is reading the stuff you need from the registry, and from that point on using an array (or a multiple of arrays) to do what you need to do. Forget about the listview totally as that is not needed (except for maybe showing the user something; but certainly not for the updating/computing/replacing/etc)...
Reading from the registry is 1 api call, updating a listview is a multitude of api-calls from memory calculations to graphic updates and rendering and what not.