ListView Control

This is my code. But it will get sorted in descending order. I don't want it to be sorted. what am I supposed to do.

LVCOLUMN lvc;

lvc.mask = LVCF_TEXT|LVCF_WIDTH;
lvc.cx = 100;
lvc.pszText = _T("Property");
ListView_InsertColumn(hWndList,0,&lvc);

lvc.cx = 500;
lvc.pszText = _T("Value");
ListView_InsertColumn(hWndList,1,&lvc);

LVITEM lvi;

lvi.mask = LVIF_TEXT;
lvi.iItem = 0;
lvi.iSubItem = 0;
lvi.pszText = _T("File Name");
ListView_InsertItem(hWndList,&lvi);
lvi.iItem = 1;
lvi.pszText = _T("File Size");
ListView_InsertItem(hWndList,&lvi);
lvi.iItem = 2;
lvi.pszText = _T("PE Size");
ListView_InsertItem(hWndList,&lvi);
lvi.iItem = 3;
lvi.pszText = _T("Created");
ListView_InsertItem(hWndList,&lvi);
lvi.iItem = 4;
lvi.pszText = _T("Modified");
ListView_InsertItem(hWndList,&lvi);
lvi.iItem = 5;
lvi.pszText = _T("Accessed");
ListView_InsertItem(hWndList,&lvi);
lvi.iItem = 6;
lvi.pszText = _T("MD5");
ListView_InsertItem(hWndList,&lvi);
There is a property in the ListView class to turn off sorting.
Thanks it is solved now. I should not pass Extended style of list view in CreaeWindow. I have to pass it with ListView_SetExtendedStyles
Topic archived. No new replies allowed.