Bonjour,

J'ai codé quelques lignes pour tester la construction d'une ListView, mais je n'arrive pas a afficher les titres des deux colonnes ...
Les valeurs s'afichent bien par contre, mais dans l'ordre inverse !!!
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
            InitCommonControls();
            hListView =CreateWindowEx(WS_EX_CLIENTEDGE , WC_LISTVIEW, "",
                  WS_CHILD | WS_VISIBLE , 10, 10, 500, 100, hwnd, NULL, hInst, NULL);
/*
            hwndHeader = CreateWindowEx(0, WC_HEADER, NULL, 
                WS_CHILD | WS_VISIBLE | WS_BORDER | HDS_BUTTONS | HDS_HORZ, 
                0, 0, 500, 20, hListView, NULL, hInst, NULL);
            DoInsertItem(hwndHeader, 0, 50, (LPSTR)"colonne 1");
            DoInsertItem(hwndHeader, 1, 50, (LPSTR)"colonne 2");
*/
 
            lvc.mask = LVCF_FMT | LVCF_ORDER  | LVCF_TEXT;
            lvc.fmt = LVCFMT_LEFT;
            lvc.cxMin = 50;
            lvc.cx = 180;
            lvc.cxDefault = 50;
            lvc.cxIdeal = 180;
            strcpy_s (szit, sizeof(szit), "colonne 1");
            lvc.pszText = (LPTSTR)szit;
            lvc.cchTextMax = sizeof(szit);
            lvc.iOrder = 0;
            ListView_InsertColumn(hListView,0,(LPARAM)&lvc);
//
            lvc.mask = LVCF_FMT | LVCF_ORDER  | LVCF_TEXT;
            lvc.fmt = LVCFMT_LEFT;
            lvc.cxMin = 50;
            lvc.cx = 180;
            lvc.cxDefault = 50;
            lvc.cxIdeal = 180;
            strcpy_s (szit, sizeof(szit), "colonne 2");
            lvc.pszText = (LPTSTR)szit;
            lvc.cchTextMax = sizeof(szit);
            lvc.iOrder = 1;
            ListView_InsertColumn(hListView,1,(LPARAM)&lvc);
//
//
      ZeroMemory(&lvi, sizeof(LVITEM));
      lvi.mask = LVIF_TEXT;
      strcpy_s (szit, sizeof(szit), "data_colonne 1");
			lvi.pszText = szit;
			lvi.cchTextMax = sizeof(szit);
			lvi.iSubItem=0;
      ListView_InsertItem(hListView, &lvi);
      strcpy_s (szit, sizeof(szit), "data_colonne 2");
			lvi.pszText = szit;
			lvi.cchTextMax = sizeof(szit);
			lvi.iSubItem=0;
      ListView_InsertItem(hListView, &lvi);
//
J'ai du oublié quelque chose, mais je vois pas quoi ...
Si quelqu'un a une idée,
Merci d'avance