Salut,

je suis en train d'essayer de changer la couelur d'une DialogBox et de certains controles.

j'utilise donc le code donné dans la FAQ.

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
 
HBRUSH CTestsDiversDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor) 
{
    HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
/* CTLCOLOR_BTN         button control
   CTLCOLOR_DLG         dialog box
   CTLCOLOR_EDIT        edit control
   CTLCOLOR_LISTBOX     list box
   CTLCOLOR_MSGBOX      message box
   CTLCOLOR_SCROLLBAR   scroll bar
   CTLCOLOR_STATIC      static text, frame, or rectangle 
*/
 
// TODO: Change any attributes of the DC here
 
// par exemple en fonction de nCtlColor voir doc.
    switch(nCtlColor)
    {
        // Intercepte le message pour la dialogue et les statics. 
        case CTLCOLOR_DLG:
        case CTLCOLOR_STATIC  :
                //  Fixe la couleur d’ecriture du texte
                pDC->SetTextColor(m_ClrCtlText);
                // enventuellement suivant les cas
                // pDC->pDC->SetBkColor(m_ClrCtlBk);
                // Fixe le fond en transparent  pour le texte 
                // à ne pas faire pour un edit.
                pDC->SetBkMode(TRANSPARENT);
                // retourne le handle de la brush pour le fond si il existe.
                If(m_HbrClrCtlBk ) hbr = m_HbrClrCtlBk;
                break;
     }
    // TODO: Return a different brush if the default is not desired
    return hbr;
}
mon probleme est que je ne sais pas quoi passer en paramètre
qu'est ce qu'un CDC ???