Hello !!
Encore un probleme de ListView !!
Toutes les colonnes sont bien remplies lorsque j'execute :
void AddLineListView(int ligne, int colonne, char* texte, BOOL first)
{
HWND hwndListView = GetDlgItem(hDlg,IDC_LIST1);
LVITEM lvLine = {0};
lvLine.mask = LVIF_TEXT;
lvLine.iItem = ligne;
lvLine.iSubItem = colonne;
lvLine.pszText = texte;
if( first == TRUE )
ListView_InsertItem(hwndListView, (LPARAM)&lvLine);
else
ListView_SetItem(hwndListView, (LPARAM)&lvLine);
}
par contre la premiere colonne est triée automatiquement, mais les informations des colonnes 2, 3 ... semblent tout simplement perdues!!!
voila comment je crée mais colonnes:
void initListView()
{
HWND hwndListView = GetDlgItem(hDlg,IDC_LIST1);
LV_COLUMN lvColumn;
lvColumn.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM ;
lvColumn.fmt = LVCFMT_LEFT;
lvColumn.cx = 162;
lvColumn.pszText = "Titre";
lvColumn.cchTextMax = lstrlen(lvColumn.pszText);
ListView_InsertColumn(hwndListView,0,(LPARAM)&lvColumn);
lvColumn.cx = 162;
lvColumn.pszText = "Artiste";
lvColumn.cchTextMax = lstrlen(lvColumn.pszText);
ListView_InsertColumn(hwndListView,1,(LPARAM)&lvColumn);
lvColumn.cx = 162;
lvColumn.pszText = "Album";
lvColumn.cchTextMax = lstrlen(lvColumn.pszText);
ListView_InsertColumn(hwndListView,2,(LPARAM)&lvColumn);
lvColumn.pszText = "Chemin";
lvColumn.cchTextMax = lstrlen(lvColumn.pszText);
ListView_InsertColumn(hwndListView,3,(LPARAM)&lvColumn);
ListView_SetExtendedListViewStyleEx(hwndListView,0 , LVS_EX_FULLROWSELECT | LVS_EX_HEADERDRAGDROP);
}
Quelqu'un a-t-il une idée sur l'origine du probleme?
Est-il possible d'empecher le tri automatique des colonnes?
Merci,
Melkior le necrarque.
Afficher la suite