News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Update Treeview Item using TVM_SETITEM?

Started by newAsm, May 08, 2008, 12:38:16 PM

Previous topic - Next topic

newAsm

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

Tedd

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..
No snowflake in an avalanche feels responsible.

newAsm

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