I am working on a program in which all files and size should be indicated (at the moment ...). I created a simple application that should write data to a list. I am trying to write data in two columns (the first should be the name, and next to it, in the other column, the size), but I canβt understand how I should do it. Can anybody help me?
Thanks in advance!
Kampi
Update:
I am trying to use ListControl., But unfortunately I cannot. I can successfully compile my application, but I only see an empty rectangle. Does anyone know what I'm doing wrong?
BOOL CGetFileListDlg::OnInitDialog() { CDialog::OnInitDialog(); // Set the icon for this dialog. The framework does this automatically // when the application main window is not a dialog SetIcon(m_hIcon, TRUE); // Set big icon SetIcon(m_hIcon, FALSE); // Set small icon // TODO: Add extra initialization here LVITEM lvItem; LVCOLUMN lvColumn; int nCol; lvColumn.mask = LVCF_FMT | LVCF_TEXT | LVCF_WIDTH; lvColumn.fmt = LVCFMT_CENTER; lvColumn.cx = 10; lvColumn.pszText = _T("Filename"); ListView_InsertColumn( m_List, 0, &lvColumn ); ListView_SetItemText( m_List, 0, 0, _T("TEST") ); return TRUE; // return TRUE unless you set the focus to a control }
source share