Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This macro sets the display for days in all months that are currently visible within a month calendar control.

Syntax

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

Parameters

hwndMC

Handle to a month calendar control.

iMonths

INTvalue that indicates how many elements are in the array that lpDayStateArraypoints to.

lpDayStateArray

Long pointer to an array of MONTHDAYSTATEvalues that define how the month calendar control will draw each day in its display.

Return Value

Nonzero if successful. If the macro fails, it returns zero.

Remarks

The array at lpDayStateArraymust contain as many elements as the value returned by the following macro.

Copy Code
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 lpDayStateArraymust contain MONTHDAYSTATEvalues that correspond with all months currently in the control's display, in chronological order. This includes the two months only partially displayed before the first month and after the last month.

Related message:  MCM_SETDAYSTATE

Requirements

Header commctrl.h
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later