How do I get the text out of a listview in report style into an array?
I want it to be something like this:
[[item1],[subitem1]],[[item1],[subitem1]],[[item1],[subitem1]],
Here is some of my code:

hWndListView = CreateWindowEx(
0L, 
WC_LISTVIEW, 
"",
 WS_VISIBLE | WS_CHILD | LVS_REPORT,
0, 21, 340, 190, hWnd,
(HMENU) ID_LISTVIEW, hInstance,
 NULL);
  ListView_SetExtendedListViewStyle ( hWndListView, LVS_EX_FULLROWSELECT );
 // Here we put the info on the Coulom headers
// this is not data, only name of each header we like
 memset(&LvCol,0,sizeof(LvCol)); // Reset Coluom
LvCol.mask=LVCF_TEXT|LVCF_WIDTH|LVCF_SUBITEM; // Type of mask
LvCol.cx=0x0;                                // width between each coloum
LvCol.pszText="Time";                     // First Header
 LvCol.cx=0x30;


// Inserting Couloms as much as we want
				SendMessage(hWndListView,LVM_INSERTCOLUMN,0,(LPARAM)&LvCol); // Insert the coloum

LvCol.cx=0x120;
LvCol.pszText="Item";
SendMessage(hWndListView,LVM_INSERTCOLUMN,2,(LPARAM)&LvCol);

I can get the information from the first item and and sub item in the listview, but I don't know how to get the information from the rest. This is what I've got so far.

char *text = new char[256];
char *text2 = new char[256];
ListView_GetItemText(hWndListView, 0, 0, text, 256);
ListView_GetItemText(hWndListView, 0, 1, text2, 256);
delete [] text;
delete [] text2;

I need a way to move to the next item until there aren't any more items.

This article has been dead for over six months. Start a new discussion instead.