I am having some trouble handling the MCN_GETDAYSTATE message sent by a Windows Common Control month calendar.
I am trying to set the bolded days in response to the MCN_GETDAYSTATE message. This is the structure sent in a WM_NOTIFY message by the control window:
typedef struct tagNMDAYSTATE {
NMHDR nmhdr;
SYSTEMTIME stStart;
int cDayState;
LPMONTHDAYSTATE prgDayState;
} NMDAYSTATE, *LPNMDAYSTATE;
I can extract the nmhdr, stStart and cDayState members of the structure with no problems, but I do not understand how to handle and set the prgDayState member of the structure.
stStart gives me correctly the first day of the partially displayed previous month of the control, cDayState is 3, meaning the partially displayed previous month, the current month and the partially displayed next month, but I have no idea what to do with prgDayState.
MSDN says:
"prgDayState: Address of an array of MONTHDAYSTATE values. The buffer at this address must be large enough to contain at least cDayState elements. The first element in the array corresponds to the date in stStart."
So is prgDayState a 4 byte pointer to the array? that array is already allocated? The strange thing is that I am not filling that structure member with anything, but I get ramdom bolded dates.
MCN_GETDAYSTATE Notification:
http://msdn.microsoft.com/en-us/library/bb760935(VS.85).aspxNMDAYSTATE Structure:
http://msdn.microsoft.com/en-us/library/bb760929(VS.85).aspxMONTHDAYSTATE data type:
http://msdn.microsoft.com/en-us/library/bb760915(VS.85).aspxAnd here is the class where I am trying to use this:
http://www.ctl32.com.ar/ctl32_datepicker.aspAny help on this will be really appreciated.
Carlos Alloatti