How can I create a listview in report mode with the win32API? Just a little snippet of code. I don't need an entire wndproc/
This is a discussion on Creating Listview in Report Mode with WinAPI within the Windows Programming forums, part of the Platform Specific Boards category; How can I create a listview in report mode with the win32API? Just a little snippet of code. I don't ...
How can I create a listview in report mode with the win32API? Just a little snippet of code. I don't need an entire wndproc/
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);
"Man alone suffers so excruciatingly in the world that he was compelled to invent laughter."
Friedrich Nietzsche
"I spent a lot of my money on booze, birds and fast cars......the rest I squandered."
George Best
"If you are going through hell....keep going."
Winston Churchill