The MASM Forum Archive 2004 to 2012

General Forums => The Workshop => Topic started by: newAsm on May 08, 2008, 12:38:16 PM

Title: Update Treeview Item using TVM_SETITEM?
Post by: newAsm on May 08, 2008, 12:38:16 PM
Hi,

Need help from anyone who has created a treeview and needing to update the item label. Which control message should I use?

I had a routine that inserts the item (e.g. "Parent" label) into the treeview. The user can change that item label (e.g. from "Parent" to "Child"). I tried using TVM_SETITEM but would not work. The application crashed.

         mov      eax,[hParent]                                            ; EAX = Patent handle
         mov    tvis.hParent,eax
         mov      tvis.itemex.imask, TVIF_TEXT                      ; set mask to text change
         mov    tvis.itemex.pszText,esi
         mov      eax,[hLevel]                     ; item handle
         mov      tvis.itemex.hItem,eax               ;
         invoke    SendMessage,hTvwGroup,TVM_SETITEM,0,addr tvis

The application crashed at SendMessage. Does anyone know what have I done wrong?

Thanks...newAsm
Title: Re: Update Treeview Item using TVM_SETITEM?
Post by: Tedd on May 12, 2008, 08:29:16 PM
Are you sure your TVITEM/EX structure is correct? -- I don't see the hParent in either of them

Also, try using the plain old TVITEM struct instead of the extended version..
Title: Re: Update Treeview Item using TVM_SETITEM?
Post by: newAsm on May 13, 2008, 12:11:53 AM
Thanks Tedd, for asking if I used the right structure. You are right, I used the wrong structure. I have fixed it.

Thanks for responding..newAsm