Salut à tous.

Je travail avec devcpp et je n'arrive pas à afficherer les controls nécéssitants commctrl.h.
Pourtant j'ai bien inclus <commctrl.h>, je n'ai pas oublié l'option -lcomctl32 et je n'ai pas oublié non plus de faire appel à InitCommonControls().

En fait j'ai suivi les exemples de MSDN, mais à chaque fois il me dit que INITCOMMONCONTROLSEX n'est définit nul part.

exemple:
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
// CreateListView - creates a list-view control in report view.
// Returns the handle to the new control if successful, or NULL otherwise.
// hWndParent - handle to the control's parent window. 
 
HWND CreateListView (HWND hwndParent) 
{ 
    HWND hWndListView;
    RECT rcl; 
    INITCOMMONCONTROLSEX icex;
 
    // Ensure that the common control DLL is loaded. 
    icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
    icex.dwICC  = ICC_LISTVIEW_CLASSES;
    InitCommonControlsEx(&icex); 
 
    // Create the list-view window in report view with label editing enabled.
    GetClientRect (hWndParent, &rcl); 
 
    hWndListView = CreateWindow(WC_LISTVIEW, 
                                "", 
                                WS_CHILD | LVS_REPORT | LVS_EDITLABELS, 
                                0, 
                                0, 
                                rcl.right - rcl.left, 
                                rcl.bottom - rcl.top, 
                                hwndParent, 
                                (HMENU) ID_LISTVIEW, 
                                hInst, 
                                NULL); 
 
    if (hWndListView == NULL) 
        return NULL; 
}
si je commentarise cette portion de code
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
 INITCOMMONCONTROLSEX icex;
 
    // Ensure that the common control DLL is loaded. 
    icex.dwSize = sizeof(INITCOMMONCONTROLSEX);
    icex.dwICC  = ICC_LISTVIEW_CLASSES;
    InitCommonControlsEx(&icex);
le programme se lance mais rien n'est affiché.

Merci beaucoup de votre aide.