I am using List View Control in my program. It works fine when adding new items, updating items, or deleting items.
But I cannot search a item with LVM_FINDITEM message.
It always return -1 when searching for the index of a item.
Here is how I add items
LVITEM LvItem; // ListView Item struct
...............
LvItem.iItem = 0; // choose item
LvItem.iSubItem = 0; // Put in first coluom
LvItem.pszText = (LPSTR)task.c_str(); // Text to display
LvItem.lParam = _id;
SendMessage(_taskMgr,LVM_INSERTITEM,0,(LPARAM)&LvI tem);
Here is how I serach the index of an item
LVFINDINFO lvfi;
lvfi.flags = LVFI_PARAM;
lvfi.lParam = id;
return SendMessage(_taskMgr, LVM_FINDITEM, -1,(LPARAM)(&lvfi));
.....
The return value is always -1.
Thank you for your help.