the lParam was a IntPrt type, here the LV_ITEM definition:
[StructLayoutAttribute(LayoutKind.Sequential)]
public struct LV_ITEM
{
public LVIF mask;
public Int32 iItem;
public Int32 iSubItem;
public UInt32 state;
public UInt32 stateMask;
public String pszText;
public Int32 cchTextMax;
public Int32 iImage;
public IntPtr lParam;
}
my project is similar to this
Windows Explorer wildcard selection shell extension , there is a function to get the listviewitem index like this :
int CtxMenu::GetListViewIndex(const char* filename)
{
char path[MAX_PATH + 1];
LVITEM item = { 0 };
item.mask = LVIF_PARAM;
int count = ListView_GetItemCount(listView);
for (int t = 0; t < count; ++t)
{
item.iItem = t;
item.lParam = 0;
if (ListView_GetItem(listView, &item))
{
if (::SHGetPathFromIDList((LPCITEMIDLIST) item.lParam, path))
{
char* file = strrchr(path, '\\');
if (file != NULL)
{
if (stricmp(filename, file + 1) == 0)
{
return t;
}
}
}
}
}
return -1;
}
the LV_ITEM mask is specific to LVIF_PARAM then it is passed through ListView_GetItem macro same as the SendMessage func . after that the lParam recieved a ITEMIDLIST