Look for WM_NOTIFY msg's
Code:
// create the list view
hLV_Wnd=CreateWindow("SysListView32",NULL,WS_CHILD | WS_VISIBLE | LVS_REPORT | WS_BORDER | WS_VSCROLL | WS_EX_RIGHTSCROLLBAR | WS_TABSTOP ,0 ,0 , iWidth, iHeight, hParent, (HMENU)iCtrlID, hInst, NULL);
//insert a column, I use a loop
//the fColRatio is a percentage (per column ie 0.25 for 4 equal)
LV_COLUMN LVColumn;
LVColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT ;
LVColumn.fmt = LVCFMT_LEFT;
LVColumn.cx=(int)(iWidth*fColRatio);
LVColumn.pszText = sColTitle;
LVColumn.cchTextMax = lstrlen(sColTitle);
LVColumn.iSubItem = iNumCol;
LVColumn.iImage = 0;
LVColumn.iOrder = 0;
ListView_InsertColumn( hLV_Wnd ,iNumCol ,&LVColumn );
//add an item
LV_ITEM pItem;
if(iColumn==0)//is new item
{
pItem.mask=LVIF_TEXT | LVIF_PARAM;
pItem.iItem=Row;
pItem.iSubItem=Column;
pItem.state=0;
pItem.stateMask=0;
pItem.pszText=sDescription;
pItem.cchTextMax=STRING;
pItem.iImage=0;
pItem.lParam=Row;
ListView_InsertItem( hLV_hWnd, &pItem);
}
else// is subitem
ListView_SetItemText( hLV_hWnd, iRow, iColumn, sDescription);