RichEdit Text Color (win32api)
C / C++ / MFC
1
Posts
1
Posters
0
Views
1
Watching
-
hi.. I want to change text color of RichEdit but this code didnt work. :eek: void ChangeColor(HWND hWnd) { CHOOSECOLOR cc; static COLORREF acrCustClr[16]; COLORREF cResult; CHARFORMAT2 cf; cc.lStructSize=sizeof(cc); cc.hwndOwner=hWnd; cc.rgbResult=cResult; cc.lpCustColors = (LPDWORD) acrCustClr; cc.Flags=CC_FULLOPEN|CC_RGBINIT|CC_ANYCOLOR; if(ChooseColor(&cc)==IDOK) { cf.crTextColor=cc.rgbResult; SendDlgItemMessage(hWnd,IDC_REDIT1,EM_SETCHARFORMAT,SCF_ALL,(LPARAM)&cf); } }