Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Handling MCN_GETDAYSTATE from month calendar
Message
 
 
To
05/06/2008 14:37:24
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01321939
Message ID:
01322003
Views:
17
This message has been marked as the solution to the initial question of the thread.
Carlos,

After reading MSDN pages for NMDAYSTATE Structure and MONTHDAYSTATE, I think that you should try following


  1. Allocate a buffer for 'an array of MONTHDAYSTATE values' - 4 bytes for each item
  2. Turn on the bits for days to bold - "Each bit (1 through 31) represents the state of a day in a month".
  3. Assign the buffer address to the prgDayState in the NMDAYSTATE Structure - "prgDayState, which the receiving application must set when processing MCN_GETDAYSTATE".

Check C code sample at http://msdn.microsoft.com/en-us/library/bb760921.aspx

>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
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform