I'm writing drag&drop for my treeview, to move an item to another. D&D works fine, but I have problems moving the items correctly. Actualy I use:

              mov ebx,zielitem
              push ebx
              invoke SendMessage,treeview,TVM_GETNEXTITEM,TVGN_PARENT,ebx
              pop ebx
              cmp eax,startitem
              je  noman
              mov ebx,eax
              cmp eax,0
              jne again

              invoke memfill,addr TvItem,80,0

              mov eax,startitem
              lea ebx,TvItem
              add ebx,8
              m2m ,eax
              m2m ,0ffffffffh
              lea eax,tix3
              m2m ,eax
              m2m ,256
              invoke SendMessage,treeview,TVM_GETITEM,0,ebx

              invoke SendMessage,treeview,TVM_DELETEITEM,0,startitem

              lea ebx,TvItem
              m2m ,zielitem
              m2m ,TVI_FIRST
              invoke SendMessage,treeview,TVM_INSERTITEM,0,ebx


That work sometimes, but othertimes it goes wrong. I need something like TVM_MOVEITEM. But could not find... Any ideas?

Best regards,
Posted on 2006-11-24 10:42:13 by Nordwind64
Hi Norwind,

Unfortunately there is no TVM_MOVEITEM message :( You have to write the gist of it yourself and I'm afraid it's quite some work. I did it once but am unable to find the source at this very moment. (This upsets me more than you think!)

I know I posted it once, but I don't remember when or where. I only remember that I based it upon Iczelions drag drop example. Only that you have to manually loop with TVM_GETNEXTITEM for it's child's & siblings and create them simultaneously in the dropzone. Also extensive testing needs to be done so that the dropzone can not be a child of the draggee itself, etc etc etc...

Lots of work I can not find. :-/ Very upsetting.

If there is someone who collects everything please do a search for the word "dropzone" in that folder. I believe that's what I called it. I assume I wrote it in 2003.
Posted on 2006-11-24 20:25:08 by JimmyClif
Thank you, JimmyClif!

Ok. Hope, someone had archieved your code...  :)

Best regards,
Posted on 2006-11-25 04:25:51 by Nordwind64