Hello everybody,
The function used to insert the items is in a thread.
The goal is to display images of all files in a folder.
When the function ends I can see all the images.I use LVM_INSERTITEM to insert data into a ListView
LVM_INSERTITEM always returns 0 as index item.
So I use LVM_FINDITEM with lParam set to the lParam item of the LVITEM structure.
LVM_FINDITEM returns -1
I need some help please about this.
MOV _LvFind.flags,LVFI_PARAM
MOV RCX,[hLvImageList + RIP]
MOV RDX,RAX
XOR R8D,R8D
CALL ImageList_Add
MOV _Lvi.iImage ,EAX
MOV _ImageInfos.IndexImageList,EAX
LEA RAX,_ImageInfos.szImageFile
MOV _Lvi._mask,LVIF_DI_SETITEM OR LVIF_IMAGE OR LVIF_NORECOMPUTE OR LVIF_PARAM OR LVIF_TEXT
MOV _Lvi.pszText,RAX
MOV EAX,_iRecNo
MOV _Lvi.lParam,RAX
LEA RCX,_ImageInfos.szImageFile
CALL PathFindFileNameA
MOV RCX,[hListView + RIP]
MOV RDX,LVM_INSERTITEM
XOR R8D,R8D
LEA R9,_Lvi
MOV [R9].LVITEM.pszText,RAX
CALL SendMessageA
MOV _Lvi.iItem,EAX
MOV RAX,[_Lvi.lParam]
MOV _LvFind.lParam,RAX
MOV RCX,[hListView + RIP]
MOV RDX,LVM_FINDITEM
MOV R8D,0
LEA R9,_LvFind
CALL SendMessageA