Discussion:
CMonthCalCtrl::SetColor doesn't change visual color
(too old to reply)
Kai
2009-05-22 11:11:00 UTC
Permalink
VS2008 in Vista,

m_Cal.SetColor(MCSC_MONTHBK, 0x0000FF00);
then check color
COLORREF color = m_Cal.GetColor(MCSC_MONTHBK);
color = 0x0000FF00;
I also tried other regions. Nothing happens. What is wrong?
d***@gmail.com
2014-05-29 10:28:17 UTC
Permalink
Post by Kai
VS2008 in Vista,
m_Cal.SetColor(MCSC_MONTHBK, 0x0000FF00);
then check color
COLORREF color = m_Cal.GetColor(MCSC_MONTHBK);
color = 0x0000FF00;
I also tried other regions. Nothing happens. What is wrong?
quote from MSDN

If visual styles are active, this macro has no effect except when iColor is MCSC_BACKGROUND.

if you want to change color, you MUST to disable visual style.

HOW?
you can open stdafx.h then comment the line something like below

#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")


Then your "SetColor" will works!

Regards,

Loading...