WIN32 HelP

T_Mehdi Messages postés 294 Date d'inscription samedi 5 février 2005 Statut Membre Dernière intervention 24 juillet 2015 - 15 févr. 2005 à 23:02
ymca2003 Messages postés 2070 Date d'inscription mardi 22 avril 2003 Statut Membre Dernière intervention 3 juillet 2006 - 16 févr. 2005 à 09:00
salut a tous
bon je cherche a changer la couleur du fond et d'ecriture d'une label donc j'ai mis le code suivant:

*nb:letiquite ce trouve sur une autre dialog form

hInfo = CreateDialog(hInst,(LPCTSTR)IDD_DIALOG2,NULL,(DLGPROC)DlgInfo);
ShowWindow(hInfo,SW_SHOW);



HDC dcinfo=GetDC(GetDlgItem(hInfo,ID_LABEL));


SetBkMode(dcinfo,RGB(192,208,240));


SetTextColor(dcinfo,RGB(150,0,255)

le prob c que ca marche pas

3 réponses

bayeto Messages postés 224 Date d'inscription mardi 12 août 2003 Statut Membre Dernière intervention 18 octobre 2010
16 févr. 2005 à 00:58
yep a mon avis va falloir subclasser ton controle. Ou alors en reponse à un WM_PAINT du dialogue...faut tester.
0
ymca2003 Messages postés 2070 Date d'inscription mardi 22 avril 2003 Statut Membre Dernière intervention 3 juillet 2006 7
16 févr. 2005 à 08:59
Dans le parent, il faut traiter WM_CTLCOLOREDIT. wParam contiendra le DC avec lequel tu pourras faire SetTextColor et SetBkColor.
0
ymca2003 Messages postés 2070 Date d'inscription mardi 22 avril 2003 Statut Membre Dernière intervention 3 juillet 2006 7
16 févr. 2005 à 09:00
S'il s'agit d'un contrôle STATIC, il faudra traiter WM_CTLCOLORSTATIC.
0
Rejoignez-nous