I must change color of title bar, from white to blue..I tried with:
<pre>
int CDlgEstimateTime::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CDialog::OnCreate(lpCreateStruct) == -1)
return -1;
int aElements[2] = { COLOR_WINDOW, COLOR_ACTIVECAPTION };
DWORD aOldColors[2];
COLORREF new_c;
new_c = RGB(255, 255, 255);
SetSysColors(2, aElements, &new_c);
return 0;
}
it doesn't work, color of title bar doesn't change, but change color of CTrlList insdide my dialog, I don't know why..
What I have tried:
How Can I solve? I tried code that I've written
I tried:
<pre>
void CDlgEstimateTime::OnNcPaint()
{
COLORREF NewColor = RGB(255, 0, 0);
int flag = COLOR_ACTIVECAPTION;
::SetSysColors(1, &flag, &NewColor);
}
but sometimes it works and sometimes title bar is white, I don't know why