Hello!, here is my porblem:

I am tring to crearte a appcation when searches the partiton for .tmp files but i have found that there are

2 diffrent temp files on 2 diffrent folders with same name. Now i show the list only using the name and not the

path. So the user may get confused on which file to remove so i need to remove the duplicate entry from the

entry. I tried solving the problem out but couldnt get the way to find the ITEMNUMBER to delete Here is my code:
mypname db "tp234.tmp",0
mov d,0
mov d,0
mov d,0

push OFFSET mypname
push OFFSET lvf.psz
call lstrcpy

invoke SendMessage,hsub,LVM_GETCOLUMN,-1,ADDR lvf
mov hindex,eax ;; I get 1 as the return value i dont know how to get the the item index
invoke SendMessage,hsub,LVM_DELETEITEM,hindex,0 ;; Here the 2nd item in the list gets deleted
xor eax,eax
Posted on 2004-05-25 13:44:21 by telophase
im not sure if you made an error when you typed in your code but shouldnt you be using LVM_FINDITEM instead of LVM_GETCOLUMN to determine the index of the item?
Posted on 2004-05-25 18:38:40 by smurf
Yes you are right but still even when i "corrected" my code still cant find the item index.

The first SendMessage returns FFFFFFFFh and the second SendMessage returns 0

I dont know why this is happening :confused:
Posted on 2004-05-25 22:26:00 by telophase

mov LVF.psz,offset szString
invoke SendMessage,hCurrentLV,LVM_FINDITEM,-1,addr LVF
cmp eax,-1
jne _inlist

LVM_FINDITEM returns -1 if it finds the text and the index if not.

That should be all of the params of the LVF struct that you need to fill in.

hope that helps,
Posted on 2004-05-26 15:28:55 by Will
Oh, and in the app that I cut that out of I just use that snippet prior to adding the item to the listview so that I don't put any dupes in there in the first place. Maybe you can do that as well.

Posted on 2004-05-26 15:31:11 by Will
Ya it helped a lot. :alright:

Actually after successfully completing this is my process i was thinking of

accessing the LisView of other processes(like explorer) and get the desired item index it that possible too???

Posted on 2004-05-26 22:23:46 by telophase
a similar thread was started not too long ago regarding listviews in other processes.

Posted on 2004-05-27 00:20:08 by smurf
But the method used in the link you posted Uses VirtualAllocEx which is available under xp/2k only wot about

win 9x ?
Posted on 2004-05-27 00:29:33 by telophase