MonthCal_SetDayState macro

Sets the day states for all months that are currently visible within a month calendar control. You can use this macro or send the MCM_SETDAYSTATE message explicitly.

Syntax


BOOL MonthCal_SetDayState(
  HWND hwndMC,
  INT iMonths,
  LPMONTHDAYSTATE lpDayStateArray
);

Parameters

hwndMC

Type: HWND

Handle to a month calendar control.

iMonths

Type: INT

Value of type int indicating how many elements are in the array that lpDayStateArray points to.

lpDayStateArray

Type: LPMONTHDAYSTATE

Pointer to an array of MONTHDAYSTATE values that define how the month calendar control will draw each day in its display.

Return value

Returns nonzero if successful, or zero otherwise.

Remarks

An application can explicitly set day state information by using this macro, but the state will not persist when a different part of the calendar is scrolled into view. Day state information is usually set in response to the MCN_GETDAYSTATE notification code, which is sent whenever the control needs to be refreshed.

The array at lpDayStateArray must contain as many elements as the value returned by the following macro:

MonthCal_GetMonthRange(hwndMC, GMR_DAYSTATE, NULL);

The preceding macro returns the total number of months that are in complete or partial view within the month calendar's display.

Keep in mind that the array at lpDayStateArray must contain MONTHDAYSTATE values that correspond with all months currently in the control's display, in chronological order. This includes the two months that may be partially displayed before the first month and after the last month.

Requirements

Minimum supported client

Windows 2000 Professional [desktop apps only]

Minimum supported server

Windows 2000 Server [desktop apps only]

Header

Commctrl.h

See also

Using Month Calendar Controls

 

 

Community Additions

ADD
Show:
© 2014 Microsoft