I'm writing an application in Visual C++ 6.0 on Windows2000. I currently have a pushbutton that will invoke the CColorDialog interface. When the user selects a color, I get the color from the CColorDialog and I want to change the color of an edit in the dialog to that new color.
I know how to change the color of edit boxes in general. My question is, how do you do it with a dynamic RGB value?
In general you create the brush with CreateSolidBrush() somewhere (probably constructor), then in the OnCtlColor function you do something to the effect:
if ( nCtlColor == CTLCOLOR_STATIC )
int nID = pWnd->GetDlgCtrlID();
if ( nID == IDC_TEST_EDIT )
pDC->SetBkColor( RGB(255,0,0) );
you need to return a brush somehow....but it's always changing.....any help would be appreciated.