Hi All!
Please give me example of right usage of TVM_SETITEM message in  a Tree-View Control.
I've tried this

.elseif eax==WM_NOTIFY
mov edi,lParam
assume edi:ptr NM_TREEVIEW
.if .hdr.code==TVN_SELCHANGED
.if (.itemNew.state==TVIS_SELECTED)
mov .itemOld._mask,TVIF_IMAGE
mov .itemOld.iImage,2
invoke SendMessage,hwndTreeView,TVM_SETITEM,0,.itemOld.hItem
.endif
.endif

I need the Item change Image after has been selected.
Thanks a lot.
Posted on 2006-07-14 23:01:02 by w_REST_le_R
A treenode has two image properties - one for "normal" state (TVIF_IMAGE flag and iImage structure member) and one for "selected" state (TVIF_SELECTEDIMAGE flag and iSelectedImage structure member). You do not need to change the image yourself - the treeview control will do it (provided you supplied the "selected" image while adding a node to the treeview).
Posted on 2006-07-17 15:09:27 by Morris
I've already Set this property but I want to have that image that in iSelectedImage to draw when image was selected once. After user has clicked.While is another item is selected.I want the example of TVM_SETITEM usage. Standard MSDN-help examples i've tested.
Posted on 2006-07-19 20:28:46 by w_REST_le_R
Hi All!
Please help me to find out to work with TreeView Control! :shock:
I am quite newbie to MASM and asm also so a little help from gurus will be appreciable :D
All i need is control behavior like in the attachment.
But that was made by Delphi. I need a twin coded in masm because delphi is too expensive for me ;)
All job i would like to do by myself. I concerned by one little trouble only.

You can send TVM_GETNEXTITEM message to the tree view control to retrieve the handle to the tree view item that has the attribute(s) you specified.

This quotation is from Iczelion tuto#19. But i've tried to send TVM_GETNEXTITEM with TVGN_CARET
and TVM_GETITEM and TVM_SETITEM in all possible combinations of parameters: all this efforts was unavailing. Always NULL returned.
Please give me working example of plain TVM_GETITEM or TVM_SETITEM usage.
Thanks all, who will response this help shout
Attachments:
Posted on 2006-07-21 15:57:22 by w_REST_le_R
You probably are not filling out the tv_item structure properly before calling the TreeView with TVM_GETNEXTITEM.

You have to populate the TV_ITEM structure with information about what to retrieve or the it will always return FALSE.

Here's an quick example of how it should be done. Hope this helps you a bit.

Attachments:
Posted on 2006-07-22 10:39:23 by JimmyClif

Here's an quick example of how it should be done. Hope this helps you a bit.

Thanks a lot,i will look trought carefuly
Posted on 2006-07-22 15:34:31 by w_REST_le_R
JimmyClif,

Thanks for the example, I was about to create a TreeView and this will help!

I also found your Calendar example and am enjoying that.

Thanks,

farrier
Posted on 2006-07-23 15:57:14 by farrier
farrier,

You're very welcome. This example is very basic, if you have other questions regarding Treeviews feel free to ask ;)
Posted on 2006-07-23 18:21:59 by JimmyClif
JimmyClif,
You've done great work thanks,the example is complete. I've found my mistake. Especially the tour to history of USA was interesting ;) I am writing a application for string searching in files on local drivers with  my own indexing service - a substitute for standard windows file search utility, so ... I will have a lot of questions during the process, thus dont disappear PLEASE
Posted on 2006-07-25 06:49:27 by w_REST_le_R