Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Handling MCN_GETDAYSTATE from month calendar
Message
From
05/06/2008 14:37:24
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Handling MCN_GETDAYSTATE from month calendar
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01321939
Message ID:
01321939
Views:
164
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).aspx

NMDAYSTATE Structure:
http://msdn.microsoft.com/en-us/library/bb760929(VS.85).aspx

MONTHDAYSTATE data type:
http://msdn.microsoft.com/en-us/library/bb760915(VS.85).aspx

And here is the class where I am trying to use this:
http://www.ctl32.com.ar/ctl32_datepicker.asp

Any help on this will be really appreciated.

Carlos Alloatti
Next
Reply
Map
View

Click here to load this message in the networking platform