pas de jeux de mots vaseux

je n'arrive pas a détruire les boutons une fois créé.
j'ai un tableau global
et ensuite, dans ma fonction callback :
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
case WM_CHARGER:
        if(charger==true){

                boutons[0] = CreateWindow("BUTTON", "640*480", WS_CHILD | WS_VISIBLE,
        5, 5, 150, 30, fenetrePrincipale, (HMENU)ID_640, instance, NULL);

                boutons[1] = CreateWindow("BUTTON", "800*600", WS_CHILD | WS_VISIBLE,
        160, 5, 150, 30, fenetrePrincipale, (HMENU)ID_800, instance, NULL);

                boutons[2] = CreateWindow("BUTTON", "1024*768", WS_CHILD | WS_VISIBLE,
        5, 45, 150, 30, fenetrePrincipale, (HMENU)ID_1024, instance, NULL);

                boutons[3] = CreateWindow("BUTTON", "1280*1024", WS_CHILD | WS_VISIBLE,
        160, 45, 150, 30, fenetrePrincipale, (HMENU)ID_1280, instance, NULL);

        }
        return 0;
je créé les boutons . si après les avoir créé, j'utilise DestroyWindow, ça marche (m'enfin ... un peu inutile)
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
case WM_COMMAND:
            switch(LOWORD(wParam))
            {
                case ID_B_QUIT:
                SendMessage(fenetrePrincipale, WM_DESTROY, 0, 0);
                return 0;

                case ID_640:
                resolution=640;
                DestroyWindow(boutons[0]);
                DestroyWindow(boutons[1]);
                DestroyWindow(boutons[2]);
                DestroyWindow(boutons[3]);
                boutons[0] = CreateWindow("BUTTON", "Tyrie", WS_CHILD | WS_VISIBLE,
        5, 5, 150, 30, fenetrePrincipale, (HMENU)ID_TYR, instance, NULL);

                boutons[1] = CreateWindow("BUTTON", "Cantha", WS_CHILD | WS_VISIBLE,
        160, 5, 150, 30, fenetrePrincipale, (HMENU)ID_CANTH, instance, NULL);

                boutons[2] = CreateWindow("BUTTON", "Elona", WS_CHILD | WS_VISIBLE,
        5, 45, 150, 30, fenetrePrincipale, (HMENU)ID_ELO, instance, NULL);

                boutons[3] = CreateWindow("BUTTON", "", WS_CHILD | WS_VISIBLE,
        160, 45, 150, 30, fenetrePrincipale, (HMENU)WM_CHARGER, instance, NULL);

                return 0;
alors, ici, si j'utilise DestroyWindow, sa ne mache pas -_-' ou alors , je m'en sert mal :'(

merci