Salut
je suis un peu nouveaux dans la programmation des controles particulierement le dialogue avec EVC 4.0 sp4.
Je voudrais savoir comment on ferme un dialogue box lancer avec DialogBox à partir d'un autre dialogue(principale), je sais que en general on utilise EndDialog mais le probleme ce qu'il ferme le dialogue secondaire et en même temps le principale , mais lorsque je fermes avec le boutton anuler ou ok il y a pas des problèmes.
si vous pouvez m'aider car je sais plus trop quoi faire.
Merci d'avance!!!

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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
//***CODE***
HRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
HMENU hmenu;
    int wmId, wmEvent;
 
    switch (message) 
    {
        case WM_COMMAND:
            wmId = LOWORD(wParam); 
            wmEvent = HIWORD(wParam); 
 
            switch (wmId)
            {    
                case IDM_HELP_about:
                    ....
                 break;
-->> SECONDAIRE     case ID_INIT:
                    DialogBox(g_hInst, (LPCTSTR)IDD_DIALOGINIT, hWnd, (DLGPROC)dlgOptions_callback);
                    break;
                case IDOK:
 
            }
            break;
        case WM_CREATE:
        case WM_DESTROY:
        case WM_SIZE:
}
}
}
break;
        default:
            return DefWindowProc(hWnd, message, wParam, lParam);
}
return 0;
}
 
****partie fermeture****
BOOL CALLBACK dlgOptions_callback(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg) {
 
        case WM_INITDIALOG:        
            WindowsUtils_InitDialog(hwndDlg); // Create a Done button and size it.
            g_ptRep = new PointRep(MAXLISTPR);
            dlgOptions_init(hwndDlg);
            return TRUE; 
 
        case WM_COMMAND:
 
switch ((int)LOWORD(wParam)) {
 
case IDC_ENREG:
                    {
.....
                    if(fin == 0){
-->>FERMETURE            EndDialog(hwndDlg, LOWORD(wParam)); 
                        }
                        else{
                            return TRUE;
                        }
                    }
                    break;
case IDCANCEL:
                        EndDialog(hwndDlg, LOWORD(wParam));
                        break; 
 
                case IDOK:
                        EndDialog(hwndDlg, LOWORD(wParam));
                        break;
 
default:
break;
}
}
 
return FALSE;
}