Friends,

I want to enumerate (get the handle) of ALL items (parents and childs) one after the other; Any help would help!

Regards,
akyprian
Posted on 2003-03-06 08:55:58 by akyprian
Gunner has a nice algorithm to search a treeview for all handles in his copy routine here. There is no easy way to do this other than a recursive TVM_GETNEXTITEM type routine.

Donkey
Posted on 2003-03-06 09:24:51 by donkey
Thanks once again donkey. I thought it might be a little less code. I'll see what to do.
Posted on 2003-03-06 09:30:26 by akyprian
unfortunatly, there is no "short" code to do it. You have to loop through all of the nodes. As donkey mentioned, I posted some code to copy a treeview to another treeview, so take a look at that, and modify it to your needs... If you have any questions about it, ask away.
Posted on 2003-03-06 09:43:29 by Gunner
Gunner,
You can try to optimize your proc CopyTree:
- use DispatchMessage(one push) rather then SendMessage(four pushes)
- use some MSG structures with "constant" parameters
- use some tvis and tvi structures, tvis1, tvis2,...with "constant" parameters
Your proc will have two parts: Structures Initialization and Loop

Note: "constant" means that you change zero, one or two structure's parameters in each loop

Regards,
Lingo
Posted on 2003-03-06 13:10:03 by lingo12